Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
CaosDB Python Integration Tests
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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
caosdb
Software
CaosDB Python Integration Tests
Commits
e34a2059
Commit
e34a2059
authored
7 months ago
by
Florian Spreckelsen
Browse files
Options
Downloads
Plain Diff
Merge branch 'dev' into f-bug-fit-95-obligatory-property-xfail
parents
2748c6dd
2c20954e
No related branches found
No related tags found
1 merge request
!85
TST: Added test for https://gitlab.com/linkahead/linkahead-server/-/issues/280 and update changelog
Pipeline
#58584
passed
7 months ago
Stage: info
Stage: setup
Stage: cert
Stage: style
Stage: test
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
CHANGELOG.md
+1
-0
1 addition, 0 deletions
CHANGELOG.md
tests/test_issues_pylib.py
+29
-0
29 additions, 0 deletions
tests/test_issues_pylib.py
with
30 additions
and
0 deletions
CHANGELOG.md
+
1
−
0
View file @
e34a2059
...
...
@@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added (for new features)
*
Tests for
[
linkahead-server#280
](
https://gitlab.com/linkahead/linkahead-server/-/issues/280
)
*
Test for
[
caosdb-pylib#119
](
https://gitlab.com/linkahead/linkahead-pylib/-/issues/119
)
*
Test for
[
caosdb-pylib#89
](
https://gitlab.com/linkahead/linkahead-pylib/-/issues/89
)
*
Test for
[
caosdb-pylib#103
](
https://gitlab.com/linkahead/linkahead-pylib/-/issues/103
)
*
Tests for entity state
[
caosdb-server!62
](
https://gitlab.com/caosdb/caosdb-server/-/merge_requests/62
)
...
...
This diff is collapsed.
Click to expand it.
tests/test_issues_pylib.py
+
29
−
0
View file @
e34a2059
...
...
@@ -36,6 +36,7 @@ import pytest
from
linkahead
import
administration
as
admin
from
linkahead.exceptions
import
(
TransactionError
,
HTTPClientError
)
from
linkahead.apiutils
import
compare_entities
,
empty_diff
,
merge_entities
CURATOR_ROLE
=
"
curator
"
...
...
@@ -138,6 +139,34 @@ def test_gitlab_com_108():
print
(
"
deleted
"
)
def
test_gitlab_com_119
():
"""
Test that merge_entities works on properties with id but no name.
See https://gitlab.com/linkahead/linkahead-pylib/-/issues/119 and
https://gitlab.indiscale.com/caosdb/customers/f-fit/management/-/issues/94
"""
prop
=
db
.
Property
(
name
=
"
Test
"
,
datatype
=
db
.
TEXT
).
insert
()
rt
=
db
.
RecordType
(
name
=
"
TestRT
"
).
insert
()
rec1
=
db
.
Record
(
name
=
"
TestRec
"
).
add_parent
(
rt
)
rec2
=
db
.
Record
(
name
=
"
TestRec
"
).
add_parent
(
rt
)
rec1
.
add_property
(
id
=
prop
.
id
,
value
=
"
something
"
)
# Ensure rec1 has prop, rec2 does not
assert
not
empty_diff
(
rec1
,
rec2
)
assert
len
(
rec2
.
properties
)
==
0
diff1
,
diff2
=
compare_entities
(
rec1
,
rec2
)
assert
prop
.
id
in
diff1
[
"
properties
"
]
assert
None
not
in
diff1
[
"
properties
"
]
assert
len
(
diff2
[
"
properties
"
])
==
0
# Merge and check rec2 now has prop
merge_entities
(
rec2
,
rec1
)
assert
rec2
.
get_property
(
prop
)
is
not
None
assert
empty_diff
(
rec1
.
get_property
(
prop
),
rec2
.
get_property
(
prop
))
def
test_gitlab_com_120
():
"""
Test that an update doesn
'
t add unwanted subproperties.
...
...
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