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
Merge requests
!19
ENH: add resolve_value to Property
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
ENH: add resolve_value to Property
f-resolve-value
into
dev
Overview
0
Commits
17
Pipelines
3
Changes
1
Merged
Henrik tom Wörden
requested to merge
f-resolve-value
into
dev
3 years ago
Overview
0
Commits
17
Pipelines
3
Changes
1
Expand
https://gitlab.com/caosdb/caosdb-pylib/-/merge_requests/64
0
0
Merge request reports
Viewing commit
9e8a065d
Prev
Next
Show latest version
1 file
+
2
−
2
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
9e8a065d
style
· 9e8a065d
Alexander Kreft
authored
3 years ago
unittests/test_apiutils.py
+
2
−
2
Options
@@ -73,7 +73,7 @@ def test_id_query():
def
test_resolve_reference
():
original_retrieve_entity_with_id
=
caosdb
.
apiutils
.
retrieve_entity_with_id
caosdb
.
apiutils
.
retrieve_entity_with_id
=
lambda
eid
:
db
.
Record
(
id
=
eid
)
prop
=
db
.
Property
(
id
=
1
,
datatype
=
db
.
REFERENCE
,
value
=
100
)
prop
.
is_valid
=
lambda
:
True
items
=
[
200
,
300
,
400
]
@@ -95,7 +95,7 @@ def test_resolve_reference():
assert
i
.
id
==
500
assert
isinstance
(
i
,
db
.
Entity
)
no_reference
=
db
.
Property
(
id
=
5000
,
datatype
=
db
.
INTEGER
,
value
=
2
)
no_reference
=
db
.
Property
(
id
=
5000
,
datatype
=
db
.
INTEGER
,
value
=
2
)
resolve_reference
(
no_reference
)
assert
no_reference
.
value
==
2
assert
no_reference
.
datatype
is
db
.
INTEGER
Loading