Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
caosdb-advanced-user-tools
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
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-advanced-user-tools
Commits
3c7cb1cc
Commit
3c7cb1cc
authored
1 year ago
by
Florian Spreckelsen
Browse files
Options
Downloads
Patches
Plain Diff
TST: Adapt unittest to removed parent keyword
parent
9f9aa7b8
No related branches found
Branches containing commit
No related tags found
Tags containing commit
2 merge requests
!100
WIP: Filling XLSX: Seems to be working.
,
!91
F remove deprecated parent
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
unittests/test_yaml_model_parser.py
+6
-11
6 additions, 11 deletions
unittests/test_yaml_model_parser.py
with
6 additions
and
11 deletions
unittests/test_yaml_model_parser.py
+
6
−
11
View file @
3c7cb1cc
...
@@ -19,7 +19,7 @@
...
@@ -19,7 +19,7 @@
import
unittest
import
unittest
from
datetime
import
date
from
datetime
import
date
from
tempfile
import
NamedTemporaryFile
from
tempfile
import
NamedTemporaryFile
from
pytest
import
deprecated_call
,
raises
,
mark
from
pytest
import
raises
,
mark
import
linkahead
as
db
import
linkahead
as
db
from
caosadvancedtools.models.parser
import
(
TwiceDefinedException
,
from
caosadvancedtools.models.parser
import
(
TwiceDefinedException
,
...
@@ -527,7 +527,7 @@ F:
...
@@ -527,7 +527,7 @@ F:
def
test_issue_36
():
def
test_issue_36
():
"""
Test whether the `parent` keyword is
deprecat
ed.
"""
Test whether the `parent` keyword is
remov
ed.
See https://gitlab.com/caosdb/caosdb-advanced-user-tools/-/issues/36.
See https://gitlab.com/caosdb/caosdb-advanced-user-tools/-/issues/36.
...
@@ -550,17 +550,12 @@ R3:
...
@@ -550,17 +550,12 @@ R3:
inherit_from_obligatory:
inherit_from_obligatory:
- R1
- R1
"""
"""
with
deprecated_call
()
:
with
raises
(
ValueError
)
as
ve
:
#
C
he
ck whether this
is a
ctually deprecated
#
T
he
keyword has been removed, so it should ra
is
e
a
regular ValueError.
model
=
parse_model_from_string
(
model_string
)
model
=
parse_model_from_string
(
model_string
)
assert
"
R3
"
in
model
assert
"
invalid keyword
"
in
str
(
ve
.
value
)
r3
=
model
[
"
R3
"
]
assert
"
parent
"
in
str
(
ve
.
value
)
assert
isinstance
(
r3
,
db
.
RecordType
)
for
par
in
[
"
R1
"
,
"
R2
"
]:
# Until removal, both do the same
assert
has_parent
(
r3
,
par
)
assert
r3
.
get_parent
(
par
).
_flags
[
"
inheritance
"
]
==
db
.
OBLIGATORY
def
test_yaml_error
():
def
test_yaml_error
():
...
...
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