Skip to content
Snippets Groups Projects
Commit a0d96f6a authored by Henrik tom Wörden's avatar Henrik tom Wörden
Browse files

Merge branch 'f-entity-retrieve-with-get_entity_by' into 'dev'

parents f9c5844f 6f2d1890
No related branches found
No related tags found
1 merge request!87Test for https://gitlab.com/linkahead/linkahead-pylib/-/issues/123
Pipeline #62819 passed
......@@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added (for new features)
* Test for [linkahead-pylib#123](https://gitlab.com/linkahead/linkahead-pylib/-/issues/123)
* Tests for [linkahead-pylib#127](https://gitlab.com/linkahead/linkahead-pylib/-/issues/127)
* Tests for [linkahead-server#280](https://gitlab.com/linkahead/linkahead-server/-/issues/280)
* Test for [caosdb-pylib#119](https://gitlab.com/linkahead/linkahead-pylib/-/issues/119)
......
......@@ -199,6 +199,29 @@ def test_gitlab_com_120():
assert len(rt1_retrieved.get_property(rt2.name).properties) == 0
@pytest.mark.xfail(reason="We do not yet consider the role during retrieve")
def test_gitlab_com_123():
"""
Test that Entity Role is taken into account when retrieving entities with
ambiguous name.
See https://gitlab.com/linkahead/linkahead-pylib/-/issues/123.
"""
# Create ambiguous situation
db.RecordType(name="TestUniquenessRecordType").insert()
f = db.File(file=__file__, path="file.py")
f.insert()
f.name = "TestUniquenessRecordType"
f.update(unique=False)
# Check that only the file is retrieved and unique retrieve works
cont = db.File("TestUniquenessRecordType").retrieve(unique=False)
assert len(cont) == 1
file = db.File("TestUniquenessRecordType").retrieve()
assert file.role == "File"
def test_gitlab_com_127():
"""
Test that the timeout option in pylinkahead.ini accepts separate
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment