Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
CaosDB Python Integration Tests
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 Python Integration Tests
Commits
660f7a36
Commit
660f7a36
authored
4 years ago
by
florian
Browse files
Options
Downloads
Patches
Plain Diff
WIP: Remove get_entity() function
parent
3bc52d56
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
tests/test_error_stuff.py
+16
-16
16 additions, 16 deletions
tests/test_error_stuff.py
tests/test_permissions.py
+1
-1
1 addition, 1 deletion
tests/test_permissions.py
with
17 additions
and
17 deletions
tests/test_error_stuff.py
+
16
−
16
View file @
660f7a36
...
...
@@ -80,10 +80,10 @@ def test_retrieval_exception_raised():
assert
isinstance
(
ee
,
EntityError
)
assert
isinstance
(
ee
,
TransactionError
)
# Correct entity causing the error:
assert
not
(
ee
.
get_
entity
()
is
None
)
assert
ee
.
get_
entity
()
.
name
==
propname
assert
not
ee
.
get_
entity
()
.
is_valid
()
assert
ee
.
get_
entity
()
.
has_errors
()
assert
ee
.
entity
is
not
None
assert
ee
.
entity
.
name
==
propname
assert
not
ee
.
entity
.
is_valid
()
assert
ee
.
entity
.
has_errors
()
def
test_insertion_no_exception_raised
():
...
...
@@ -112,13 +112,13 @@ def test_insertion_with_invalid_parents():
upe
=
te
.
value
.
get_errors
()[
0
]
print
(
upe
)
assert
isinstance
(
upe
,
UnqualifiedParentsError
)
assert
not
upe
.
get_
entity
()
is
None
assert
upe
.
get_
entity
()
.
name
==
p
.
name
assert
upe
.
get_
entity
()
.
id
==
p
.
id
assert
upe
.
get_
entity
()
.
has_errors
()
assert
upe
.
entity
is
not
None
assert
upe
.
entity
.
name
==
p
.
name
assert
upe
.
entity
.
id
==
p
.
id
assert
upe
.
entity
.
has_errors
()
assert
not
p
.
is_valid
()
assert
not
upe
.
get_
entity
()
.
is_valid
()
assert
not
upe
.
get_
entities
()
is
None
assert
not
upe
.
entity
.
is_valid
()
assert
upe
.
entities
is
not
None
def
test_insertion_with_invalid_properties
():
...
...
@@ -130,12 +130,12 @@ def test_insertion_with_invalid_properties():
p
.
insert
(
raise_exception_on_error
=
True
)
upe
=
te
.
value
.
get_errors
()[
0
]
assert
isinstance
(
upe
,
UnqualifiedPropertiesError
)
assert
not
upe
.
get_
entity
()
is
None
assert
upe
.
get_
entity
()
.
name
==
p
.
name
assert
upe
.
get_
entity
()
.
has_errors
()
assert
upe
.
entity
is
not
None
assert
upe
.
entity
.
name
==
p
.
name
assert
upe
.
entity
.
has_errors
()
assert
p
.
has_errors
()
assert
not
p
.
is_valid
()
assert
not
upe
.
get_
entity
()
.
is_valid
()
assert
not
upe
.
entity
.
is_valid
()
def
test_entity_does_not_exist
():
...
...
@@ -223,8 +223,8 @@ def test_insert_existent_entity():
te
=
te
.
value
assert
te
.
has_error
(
UniqueNamesError
)
une
=
te
.
get_errors
()[
0
]
assert
not
une
.
get_
entity
()
is
None
assert
pe
.
name
==
une
.
get_
entity
()
.
name
assert
une
.
entity
is
not
None
assert
pe
.
name
==
une
.
entity
.
name
for
p
in
(
p1
,
p2
,
p3
):
assert
not
p
in
te
.
get_all_entities
()
...
...
This diff is collapsed.
Click to expand it.
tests/test_permissions.py
+
1
−
1
View file @
660f7a36
...
...
@@ -1210,7 +1210,7 @@ def test_check_entity_acl_roles():
with
raises
(
db
.
TransactionError
)
as
cm
:
grant_permission
(
p
,
"
USE:AS_PARENT
"
,
username
=
"
asdf-non-existing
"
,
switch
=
False
)
errors
=
cm
.
value
.
get_
entity
()
.
get_errors
()
errors
=
cm
.
value
.
entity
.
get_errors
()
assert
errors
[
0
].
description
==
"
User Role does not exist.
"
db
.
administration
.
set_server_property
(
"
CHECK_ENTITY_ACL_ROLES_MODE
"
,
"
SHOULD
"
)
...
...
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