Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
caosdb-pylib
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
caosdb
Software
caosdb-pylib
Commits
32bfd737
Commit
32bfd737
authored
4 years ago
by
florian
Browse files
Options
Downloads
Patches
Plain Diff
ENH: Remove ContainerError from unit tests
parent
465dbdf5
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
unittests/test_error_handling.py
+3
-6
3 additions, 6 deletions
unittests/test_error_handling.py
with
3 additions
and
6 deletions
unittests/test_error_handling.py
+
3
−
6
View file @
32bfd737
...
...
@@ -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
c
e
.
errors
:
for
err
in
t
e
.
errors
:
if
err
.
entity
.
name
==
rec_name
.
name
:
assert
isinstance
(
err
,
UniqueNamesError
)
elif
err
.
entity
.
name
==
rec_auth
.
name
:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment