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
f869471e
Verified
Commit
f869471e
authored
1 year ago
by
Daniel Hornung
Browse files
Options
Downloads
Patches
Plain Diff
TEST: Short test for
#156
parent
10f29f96
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Pipeline
#39839
passed
1 year ago
Stage: code_style
Stage: linting
Stage: setup
Stage: test
Stage: deploy
Changes
1
Pipelines
12
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
unittests/test_issues.py
+27
-0
27 additions, 0 deletions
unittests/test_issues.py
with
27 additions
and
0 deletions
unittests/test_issues.py
+
27
−
0
View file @
f869471e
...
...
@@ -37,3 +37,30 @@ def test_issue_100():
with
raises
(
TypeError
)
as
exc_info
:
db
.
common
.
models
.
_parse_single_xml_element
(
xml_el
)
assert
"
Invalid datatype: List valued properties
"
in
str
(
exc_info
.
value
)
def
test_issue_156
():
"""
Does parse_value make a mistake with entities?
https://gitlab.indiscale.com/caosdb/src/caosdb-pylib/-/issues/156
"""
project
=
db
.
Record
(
name
=
"
foo
"
)
project
.
add_parent
(
name
=
"
RTName
"
)
# <Record name="foo">
# <Parent name="RTName"/>
# </Record>
experiment
=
db
.
Record
()
experiment
.
add_property
(
name
=
"
RTName
"
,
value
=
project
)
# <Record>
# <Property name="RTName" importance="FIX" flag="inheritance:FIX">foo</Property>
# </Record>
value
=
experiment
.
get_property
(
"
RTName
"
).
value
# <Record name="foo">
# <Parent name="RTName"/>
# </Record>
parents
=
value
.
get_parents
()
# <ParentList>
# <Parent name="RTName"/>
# </ParentList>
assert
value
is
project
assert
parents
[
0
].
name
==
"
RTName
"
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