Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
CaosDB Crawler
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
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 Crawler
Commits
3a5b3cf7
Commit
3a5b3cf7
authored
4 months ago
by
Florian Spreckelsen
Browse files
Options
Downloads
Patches
Plain Diff
TEST(identifiable): Remove unused test case
parent
63a01e6b
No related branches found
No related tags found
2 merge requests
!222
Release 0.12.0
,
!218
Multiple registered identifiables error when multiple parents exist
Pipeline
#62057
passed
4 months ago
Stage: info
Stage: setup
Stage: cert
Stage: style
Stage: test
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
unittests/test_identifiable_adapters.py
+6
-10
6 additions, 10 deletions
unittests/test_identifiable_adapters.py
with
6 additions
and
10 deletions
unittests/test_identifiable_adapters.py
+
6
−
10
View file @
3a5b3cf7
...
...
@@ -54,6 +54,8 @@ def mock_retrieve_RecordType(id, name):
"
Lab
"
:
db
.
RecordType
(
name
=
"
Lab
"
),
"
Analysis
"
:
db
.
RecordType
(
name
=
"
Analysis
"
),
"
MetaAnalysis
"
:
db
.
RecordType
(
name
=
"
MetaAnalysis
"
).
add_parent
(
"
Analysis
"
),
# Test that two parents are possible; only one of them
# (Experiment) has an identifiable.
"
Measurement
"
:
db
.
RecordType
(
name
=
"
Measurement
"
).
add_parent
(
"
Experiment
"
).
add_parent
(
"
A
"
)
}[
name
]
...
...
@@ -330,16 +332,10 @@ def test_get_registered_identifiable():
with
pytest
.
raises
(
RuntimeError
):
registered
=
ident
.
get_registered_identifiable
(
rec
)
# Test the case that the record has a parent for which no identifiable is registered
# and there is a registered identifiable for a grand parent
ident
=
CaosDBIdentifiableAdapter
()
ident
.
load_from_yaml_definition
(
UNITTESTDIR
/
"
example_identifiables.yml
"
)
rec
=
db
.
Record
().
add_parent
(
name
=
"
Measurement
"
)
registered
=
ident
.
get_registered_identifiable
(
rec
)
assert
registered
is
not
None
assert
registered
.
parents
[
0
].
name
==
"
Experiment
"
# Same again, but with two grand parents
# Test the case that the record has a parent for which no
# identifiable is registered and there is a registered
# identifiable for a grand parent. Note that this also tests the
# case of two grandparents, only one of which has an identifiable.
ident
=
CaosDBIdentifiableAdapter
()
ident
.
load_from_yaml_definition
(
UNITTESTDIR
/
"
example_identifiables.yml
"
)
rec
=
db
.
Record
().
add_parent
(
name
=
"
Measurement
"
)
...
...
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