Skip to content
GitLab
Menu
Why GitLab
Pricing
Contact Sales
Explore
Why GitLab
Pricing
Contact Sales
Explore
Sign in
Get free trial
Primary navigation
Search or go to…
Project
L
LinkAhead Python Integration Tests
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Privacy statement
Keyboard shortcuts
?
What's new
4
Snippets
Groups
Projects
Show more breadcrumbs
LinkAhead
LinkAhead Python Integration Tests
Commits
15b2e3f1
Commit
15b2e3f1
authored
10 months ago
by
Florian Spreckelsen
Browse files
Options
Downloads
Patches
Plain Diff
TST: Add test for
linkahead-pylib#120
parent
0d809f8d
No related branches found
Branches containing commit
Tags
caosdb-pylib-v0.14.0
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/test_issues_pylib.py
+31
-0
31 additions, 0 deletions
tests/test_issues_pylib.py
with
31 additions
and
0 deletions
tests/test_issues_pylib.py
+
31
−
0
View file @
15b2e3f1
...
...
@@ -90,3 +90,34 @@ def test_gitlab_com_108():
tests
=
db
.
execute_query
(
"
FIND ENTITY test*
"
,
cache
=
False
)
tests
.
delete
()
print
(
"
deleted
"
)
def
test_gitlab_com_120
():
"""
Test that an update doesn
'
t add unwanted subproperties.
See https://gitlab.com/linkahead/linkahead-pylib/-/issues/120.
"""
rt1
=
db
.
RecordType
(
name
=
"
TestType1
"
)
rt2
=
db
.
RecordType
(
name
=
"
TestType2
"
)
prop
=
db
.
Property
(
name
=
"
TestProp
"
,
datatype
=
db
.
TEXT
)
rt2
.
add_property
(
prop
)
rt1
.
add_property
(
rt2
)
# no subproperties in rt1's rt2 property:
assert
len
(
rt1
.
get_property
(
rt2
.
name
).
properties
)
==
0
db
.
Container
().
extend
([
rt1
,
rt2
,
prop
]).
insert
()
rt1_retrieved
=
db
.
RecordType
(
id
=
rt1
.
id
).
retrieve
()
# Also no subproperties after retrieval
assert
len
(
rt1_retrieved
.
get_property
(
rt2
.
name
).
properties
)
==
0
new_prop
=
db
.
Property
(
name
=
"
TestPropNew
"
,
datatype
=
db
.
INTEGER
).
insert
()
rt1_retrieved
.
add_property
(
new_prop
)
# Still no subproperties
assert
len
(
rt1_retrieved
.
get_property
(
rt2
.
name
).
properties
)
==
0
rt1_retrieved
.
update
()
# The update and addition of a new property must not change this, either.
assert
len
(
rt1_retrieved
.
get_property
(
rt2
.
name
).
properties
)
==
0
This diff is collapsed.
Click to expand it.
Florian Spreckelsen
@fspreck
mentioned in issue
linkahead-pylib#120 (closed)
·
10 months ago
mentioned in issue
linkahead-pylib#120 (closed)
mentioned in issue linkahead-pylib#120
Toggle commit list
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