Skip to content
Snippets Groups Projects
Commit fbd31edb authored by Florian Spreckelsen's avatar Florian Spreckelsen
Browse files

TST: Test error handling of update_acl function

parent 037d030d
Branches
Tags
No related merge requests found
......@@ -320,3 +320,29 @@ def test_double_insertion():
assert te.container == c2
# exactly 5 faulty entities in c2
assert len(te.entities) == 5
def test_update_acl_errors():
"""Test the special cases of entity errors when using
`Entity.update_acl`
"""
rec_ne = h.Record("TestRecordNonExisting")
with pytest.raises(TransactionError) as te:
rec_ne.update_acl()
assert te.value.has_error(EntityDoesNotExistError)
assert te.value.errors[0].entity.name == rec_ne.name
rt = h.RecordType(name="TestType").insert()
rec = h.Record(name="TestRecord").add_parent(rt).insert()
h.Record(name=rec.name).add_parent(rt).insert(unique=False)
with pytest.raises(TransactionError) as te:
h.Record(name=rec.name).update_acl()
assert te.value.has_error(AmbiguousEntityError)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment