Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
CaosDB Crawler
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 Crawler
Commits
b7d3781a
Commit
b7d3781a
authored
1 year ago
by
Alexander Schlemmer
Browse files
Options
Downloads
Patches
Plain Diff
TST: renamed two helper assertion functions
parent
ff9bc023
Branches
Branches containing commit
No related tags found
2 merge requests
!178
FIX: #96 Better error output for crawl.py script.
,
!167
Sync Graph
Pipeline
#51281
passed with warnings
1 year ago
Stage: info
Stage: setup
Stage: cert
Stage: style
Stage: test
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
unittests/test_sync_node.py
+8
-6
8 additions, 6 deletions
unittests/test_sync_node.py
with
8 additions
and
6 deletions
unittests/test_sync_node.py
+
8
−
6
View file @
b7d3781a
...
...
@@ -32,13 +32,15 @@ from caoscrawler.sync_node import SyncNode, parent_in_list, property_in_list
from
test_crawler
import
basic_retrieve_by_name_mock_up
,
mock_get_entity_by
def
compare_parents
(
p1
,
p2
):
def
assert_parents_equal
(
p1
,
p2
):
"""
Special assertion for comparing parents.
"""
for
a
,
b
in
zip
(
p1
,
p2
):
assert
a
.
id
==
b
.
id
assert
a
.
name
==
b
.
name
def
compare_properties
(
p1
,
p2
):
def
assert_properties_equal
(
p1
,
p2
):
"""
Special assertion for comparing properties.
"""
for
a
,
b
in
zip
(
p1
,
p2
):
assert
a
.
id
==
b
.
id
assert
a
.
name
==
b
.
name
...
...
@@ -62,8 +64,8 @@ def test_sync_node():
assert
sna
.
role
==
rec
.
role
assert
sna
.
name
==
rec
.
name
assert
sna
.
description
==
rec
.
description
compare
_parents
(
sna
.
parents
,
rec
.
parents
)
compare
_properties
(
sna
.
properties
,
rec
.
properties
)
assert
_parents
_equal
(
sna
.
parents
,
rec
.
parents
)
assert
_properties
_equal
(
sna
.
properties
,
rec
.
properties
)
# ... special case File (path and file attributes)
fi
=
db
.
File
(
id
=
101
,
name
=
'
101
'
,
path
=
'
/a/
'
)
snb
=
SyncNode
(
fi
)
...
...
@@ -79,8 +81,8 @@ def test_sync_node():
assert
export
.
role
==
rec
.
role
assert
export
.
name
==
rec
.
name
assert
export
.
description
==
rec
.
description
compare
_parents
(
export
.
parents
,
rec
.
parents
)
compare
_properties
(
export
.
properties
,
rec
.
properties
)
assert
_parents
_equal
(
export
.
parents
,
rec
.
parents
)
assert
_properties
_equal
(
export
.
properties
,
rec
.
properties
)
export
=
snb
.
export_entity
()
assert
export
.
role
==
fi
.
role
assert
export
.
name
==
fi
.
name
...
...
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