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
b35d9ce9
Commit
b35d9ce9
authored
4 years ago
by
Florian Spreckelsen
Browse files
Options
Downloads
Patches
Plain Diff
TST: Finsh sketch of unittests
parent
c35eb3af
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
unittests/test_error_handling.py
+13
-2
13 additions, 2 deletions
unittests/test_error_handling.py
with
13 additions
and
2 deletions
unittests/test_error_handling.py
+
13
−
2
View file @
b35d9ce9
...
...
@@ -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
():
...
...
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