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
31c5e197
Commit
31c5e197
authored
2 years ago
by
florian
Browse files
Options
Downloads
Patches
Plain Diff
TST: Extend merge-bug test
parent
15ac87c5
No related branches found
No related tags found
2 merge requests
!79
Release 0.10.0
,
!72
F fix merge entity conflicts
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
unittests/test_apiutils.py
+15
-0
15 additions, 0 deletions
unittests/test_apiutils.py
with
15 additions
and
0 deletions
unittests/test_apiutils.py
+
15
−
0
View file @
31c5e197
...
...
@@ -393,6 +393,21 @@ def test_wrong_merge_conflict_reference():
assert
rec_a
.
get_property
(
license_rt
.
name
)
is
not
None
assert
rec_a
.
get_property
(
license_rt
.
name
).
value
is
not
None
assert
isinstance
(
rec_a
.
get_property
(
license_rt
.
name
).
value
,
db
.
Record
)
assert
rec_a
.
get_property
(
license_rt
.
name
).
value
.
name
==
license_rec_a
.
name
assert
rec_a
.
get_property
(
license_rt
.
name
).
value
.
name
==
license_rec_b
.
name
assert
rec_a
.
get_property
(
"
title
"
).
value
==
"
Some dataset title
"
assert
rec_a
.
get_property
(
"
doi
"
).
value
==
"
https://doi.org/12345.678
"
# this does not compare referenced records, so it will fail
with
pytest
.
raises
(
RuntimeError
)
as
re
:
merge_entities
(
rec_a
,
rec_b
,
merge_references_with_empty_diffs
=
False
)
assert
"
Merge conflict
"
in
str
(
re
.
value
)
# ... as should this, of course
rec_b
.
get_property
(
license_rt
.
name
).
value
.
name
=
"
Another license
"
with
pytest
.
raises
(
RuntimeError
)
as
re
:
merge_entities
(
rec_a
,
rec_b
)
assert
"
Merge conflict
"
in
str
(
re
.
value
)
def
test_empty_diff
():
...
...
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