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
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
caosdb
Software
CaosDB Python Integration Tests
Commits
5d6fa0ce
Verified
Commit
5d6fa0ce
authored
2 years ago
by
Timm Fitschen
Browse files
Options
Downloads
Patches
Plain Diff
TST: add failing test for
https://gitlab.com/caosdb/caosdb-server/-/issues/178
parent
a58233f5
No related branches found
No related tags found
No related merge requests found
Pipeline
#31018
passed
2 years ago
Stage: info
Stage: setup
Stage: cert
Stage: style
Stage: test
Changes
1
Pipelines
5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/test_version.py
+13
-3
13 additions, 3 deletions
tests/test_version.py
with
13 additions
and
3 deletions
tests/test_version.py
+
13
−
3
View file @
5d6fa0ce
...
@@ -429,6 +429,7 @@ def test_bug_parent_name_in_old_version():
...
@@ -429,6 +429,7 @@ def test_bug_parent_name_in_old_version():
assert
[
OLD_NAME
]
==
[
p
.
name
for
p
in
rec_v1
.
get_parents
()]
assert
[
OLD_NAME
]
==
[
p
.
name
for
p
in
rec_v1
.
get_parents
()]
@mark.xfail
(
reason
=
"
fix https://gitlab.com/caosdb/caosdb-server/-/issues/178
"
)
def
test_reference_deleted_in_old_version
():
def
test_reference_deleted_in_old_version
():
ref_rt
=
insertion
(
"
TestReferencedObject
"
)
ref_rt
=
insertion
(
"
TestReferencedObject
"
)
rt
=
insertion
(
"
TestRT
"
)
rt
=
insertion
(
"
TestRT
"
)
...
@@ -491,14 +492,23 @@ def test_reference_deleted_in_old_version():
...
@@ -491,14 +492,23 @@ def test_reference_deleted_in_old_version():
assert
test_rec
.
get_property
(
ref_rt
)
is
None
assert
test_rec
.
get_property
(
ref_rt
)
is
None
assert
test_rec
.
version
.
predecessors
[
0
].
id
==
old_version
assert
test_rec
.
version
.
predecessors
[
0
].
id
==
old_version
# retrieve old version again. the reference (to the now deleted
entity)
# retrieve old version again
(cache on)
. the reference (to the now deleted
# is still there.
#
entity)
is still there.
old_rec
=
c
.
Container
().
retrieve
(
str
(
test_rec
.
id
)
+
"
@HEAD~1
"
,
old_rec
=
c
.
Container
().
retrieve
(
str
(
test_rec
.
id
)
+
"
@HEAD~1
"
,
sync
=
False
)[
0
]
sync
=
False
)[
0
]
assert
old_rec
.
version
.
id
==
old_version
assert
old_rec
.
version
.
id
==
old_version
assert
old_rec
.
version
.
successors
[
0
].
id
==
test_rec
.
version
.
id
assert
old_rec
.
version
.
successors
[
0
].
id
==
test_rec
.
version
.
id
assert
old_rec
.
get_property
(
p
).
value
==
"
blablabla
"
assert
old_rec
.
get_property
(
p
).
value
==
"
blablabla
"
assert
old_rec
.
get_property
(
ref_rt
).
value
==
referenced_id
assert
old_rec
.
get_property
(
ref_rt
).
value
is
None
,
"
TODO this fails
"
# retrieve old version again (cache off). the reference (to the now deleted
# entity) is NOT there
old_rec
=
c
.
Container
().
retrieve
(
str
(
test_rec
.
id
)
+
"
@HEAD~1
"
,
sync
=
False
,
flags
=
{
"
cache
"
:
"
false
"
})[
0
]
assert
old_rec
.
version
.
id
==
old_version
assert
old_rec
.
version
.
successors
[
0
].
id
==
test_rec
.
version
.
id
assert
old_rec
.
get_property
(
p
).
value
==
"
blablabla
"
assert
old_rec
.
get_property
(
ref_rt
).
value
is
None
with
raises
(
c
.
EmptyUniqueQueryError
)
as
exc
:
with
raises
(
c
.
EmptyUniqueQueryError
)
as
exc
:
c
.
execute_query
(
"
FIND ENTITY WITH ID = {}
"
.
format
(
referenced_id
),
c
.
execute_query
(
"
FIND ENTITY WITH ID = {}
"
.
format
(
referenced_id
),
...
...
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