diff --git a/unittests/test_error_handling.py b/unittests/test_error_handling.py index 1ff596b47d8d2a681186d6d4704676ef80abb7d2..e2e71085ea5a24c429a80c68ef0673ab1edc09c4 100644 --- a/unittests/test_error_handling.py +++ b/unittests/test_error_handling.py @@ -251,8 +251,19 @@ def test_container_with_faulty_elements(): assert isinstance(ce, ContainerError) # no healthy entity caused an error for good in [good_rec, good_prop]: - assert not good in te.all_errors - + assert not good in te.all_entities + # all records that caused problems + assert {rec_name, rec_auth, rec_par_prop}.issubset(te.all_entities) + # the container error contains the errors caused by the records + for err in ce.errors: + if err.entity.name == rec_name.name: + assert isinstance(err, UniqueNamesError) + elif err.entity.name == rec_auth.name: + assert isinstance(err, AuthorizationException) + elif err.entity.name == rec_par_prop.name: + # record raises both of them + assert (isinstance(err, UnqualifiedParentsError) or + isinstance(err, UnqualifiedPropertiesError)) def test_convenience_functions():