Skip to content
Snippets Groups Projects
Commit 32bfd737 authored by florian's avatar florian
Browse files

ENH: Remove ContainerError from unit tests

parent 465dbdf5
No related branches found
No related tags found
No related merge requests found
......@@ -30,7 +30,7 @@ import caosdb as db
from caosdb.common.models import raise_errors
# TODO: Import the relevant error classes once they have been finalized.
from caosdb.exceptions import (AmbiguityException,
AuthorizationException, ContainerError,
AuthorizationException,
EntityDoesNotExistError, EntityError,
EntityHasNoDatatypeError,
TransactionError, UniqueNamesError,
......@@ -271,17 +271,14 @@ def test_container_with_faulty_elements():
with raises(TransactionError) as e:
raise_errors(cont)
te = e.value
# only container on first level:
assert len(te.errors) == 1
ce = te.errors[0]
assert isinstance(ce, ContainerError)
assert te.get_container() == cont
# no healthy entity caused an error
for good in [good_rec, good_prop]:
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:
for err in te.errors:
if err.entity.name == rec_name.name:
assert isinstance(err, UniqueNamesError)
elif err.entity.name == rec_auth.name:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment