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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
caosdb
Software
caosdb-advanced-user-tools
Commits
28fb6eb0
Commit
28fb6eb0
authored
Jul 15, 2021
by
Henrik tom Wörden
Browse files
Options
Downloads
Patches
Plain Diff
fix
parent
a35e52d8
No related branches found
No related tags found
1 merge request
!8
F h5 cfood
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
unittests/test_structure_mapping.py
+5
-6
5 additions, 6 deletions
unittests/test_structure_mapping.py
with
5 additions
and
6 deletions
unittests/test_structure_mapping.py
+
5
−
6
View file @
28fb6eb0
...
@@ -44,7 +44,6 @@ class structureMappingTest(unittest.TestCase):
...
@@ -44,7 +44,6 @@ class structureMappingTest(unittest.TestCase):
self
.
assertEqual
(
val
,
tar
)
self
.
assertEqual
(
val
,
tar
)
def
test_collect_existing_structure
(
self
):
def
test_collect_existing_structure
(
self
):
# Henrik: please do not overwrite defautl names; e.g. use `emap`
emap
=
EntityMapping
()
emap
=
EntityMapping
()
reca1
=
db
.
Record
(
name
=
"
Animals
"
,
id
=
100
)
reca1
=
db
.
Record
(
name
=
"
Animals
"
,
id
=
100
)
reca2
=
db
.
Record
(
name
=
"
Dogs
"
,
id
=
200
)
reca2
=
db
.
Record
(
name
=
"
Dogs
"
,
id
=
200
)
...
@@ -111,11 +110,11 @@ class structureMappingTest(unittest.TestCase):
...
@@ -111,11 +110,11 @@ class structureMappingTest(unittest.TestCase):
collect_existing_structure
(
recd1
,
recc1
,
emap2
)
collect_existing_structure
(
recd1
,
recc1
,
emap2
)
# Test the correct assignment of the properties
# Test the correct assignment of the properties
self
.
assertTrue
(
recc2
is
emap
.
to_existing
[
recd2
.
_cuid
])
self
.
assertTrue
(
recc2
is
emap
2
.
to_existing
[
recd2
.
_cuid
])
self
.
assertTrue
(
recc3
is
emap
.
to_existing
[
recd3
.
_cuid
])
self
.
assertTrue
(
recc3
is
emap
2
.
to_existing
[
recd3
.
_cuid
])
self
.
assertTrue
(
recd2
is
emap
.
to_target
[
recc2
.
id
])
self
.
assertTrue
(
recd2
is
emap
2
.
to_target
[
recc2
.
id
])
self
.
assertTrue
(
recd3
is
emap
.
to_target
[
recc3
.
id
])
self
.
assertTrue
(
recd3
is
emap
2
.
to_target
[
recc3
.
id
])
"""
Test, if the Record `Cars` in `target_structure` have one additional Property
"""
"""
Test, if the Record `Cars` in `target_structure` have one additional Property
"""
# Test existing structure
# Test existing structure
...
@@ -123,7 +122,7 @@ class structureMappingTest(unittest.TestCase):
...
@@ -123,7 +122,7 @@ class structureMappingTest(unittest.TestCase):
self
.
assertEqual
(
len
(
recd2
.
get_properties
()),
2
)
# number of properties stay unchanged
self
.
assertEqual
(
len
(
recd2
.
get_properties
()),
2
)
# number of properties stay unchanged
for
prop_record
,
prop_em
in
zip
(
recc2
.
get_properties
(),
recd2
.
get_properties
()):
for
prop_record
,
prop_em
in
zip
(
recc2
.
get_properties
(),
recd2
.
get_properties
()):
self
.
assertTrue
(
prop_record
is
emap
.
to_existing
[
prop_em
.
_cuid
])
self
.
assertTrue
(
prop_record
is
emap
2
.
to_existing
[
prop_em
.
_cuid
])
# Test target structure
# Test target structure
self
.
assertEqual
(
len
(
recc3
.
get_properties
()),
2
)
# number of properties stay unchanged
self
.
assertEqual
(
len
(
recc3
.
get_properties
()),
2
)
# number of properties stay unchanged
...
...
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