Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
caosdb-advanced-user-tools
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-advanced-user-tools
Commits
2524bbf3
Verified
Commit
2524bbf3
authored
3 years ago
by
Daniel Hornung
Browse files
Options
Downloads
Patches
Plain Diff
WIP: Pipeline fixing.
parent
cb9b86f6
No related branches found
No related tags found
2 merge requests
!39
Release 0.4.0
,
!35
Pipeline streamlining
Pipeline
#19893
failed
3 years ago
Stage: setup
Stage: cert
Stage: style
Stage: unittest
Stage: integrationtest
Changes
3
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
README_SETUP.md
+2
-1
2 additions, 1 deletion
README_SETUP.md
integrationtests/test_assure_functions.py
+5
-6
5 additions, 6 deletions
integrationtests/test_assure_functions.py
src/caosadvancedtools/cfood.py
+1
-1
1 addition, 1 deletion
src/caosadvancedtools/cfood.py
with
8 additions
and
8 deletions
README_SETUP.md
+
2
−
1
View file @
2524bbf3
...
@@ -48,7 +48,8 @@ Optional h5-crawler:
...
@@ -48,7 +48,8 @@ Optional h5-crawler:
`integrationtest/extroot/`
directory.
`integrationtest/extroot/`
directory.
## Code Formatting
## Code Formatting
`autopep8 -i -r ./`
`make style`
## Documentation #
## Documentation #
...
...
This diff is collapsed.
Click to expand it.
integrationtests/test_assure_functions.py
+
5
−
6
View file @
2524bbf3
...
@@ -32,26 +32,25 @@ from caosadvancedtools.cfood import (assure_object_is_in_list)
...
@@ -32,26 +32,25 @@ from caosadvancedtools.cfood import (assure_object_is_in_list)
from
caosadvancedtools.guard
import
(
global_guard
,
RETRIEVE
,
UPDATE
)
from
caosadvancedtools.guard
import
(
global_guard
,
RETRIEVE
,
UPDATE
)
def
setup
_module
():
def
setup
():
"""
Delete all test entities.
"""
"""
Delete all test entities.
"""
db
.
execute_query
(
"
FIND Test*
"
).
delete
(
raise_exception_on_error
=
False
)
db
.
execute_query
(
"
FIND Test*
"
).
delete
(
raise_exception_on_error
=
False
)
def
setup
():
def
setup
_module
():
"""
Allow all updates and delete test data
"""
"""
Allow all updates and delete test data
"""
global_guard
.
level
=
UPDATE
global_guard
.
level
=
UPDATE
setup
_module
()
setup
()
def
teardown
():
def
teardown
_module
():
"""
Reset guard level and delete test data.
"""
"""
Reset guard level and delete test data.
"""
global_guard
.
level
=
RETRIEVE
global_guard
.
level
=
RETRIEVE
setup
_module
()
setup
()
def
test_assure_list_in_place
():
def
test_assure_list_in_place
():
"""
Test an in-place update with `assure_object_is_in_list`.
"""
"""
Test an in-place update with `assure_object_is_in_list`.
"""
int_list_prop
=
db
.
Property
(
name
=
"
TestIntListProperty
"
,
int_list_prop
=
db
.
Property
(
name
=
"
TestIntListProperty
"
,
datatype
=
db
.
LIST
(
db
.
INTEGER
)).
insert
()
datatype
=
db
.
LIST
(
db
.
INTEGER
)).
insert
()
rt1
=
db
.
RecordType
(
name
=
"
TestType1
"
).
add_property
(
rt1
=
db
.
RecordType
(
name
=
"
TestType1
"
).
add_property
(
...
...
This diff is collapsed.
Click to expand it.
src/caosadvancedtools/cfood.py
+
1
−
1
View file @
2524bbf3
...
@@ -391,7 +391,7 @@ class AbstractFileCFood(AbstractCFood):
...
@@ -391,7 +391,7 @@ class AbstractFileCFood(AbstractCFood):
def
assure_object_is_in_list
(
obj
,
containing_object
,
property_name
,
def
assure_object_is_in_list
(
obj
,
containing_object
,
property_name
,
to_be_updated
=
None
,
datatype
=
None
):
to_be_updated
=
None
,
datatype
=
None
):
"""
Checks whether `obj` is one of the values in the list property
"""
Checks whether `obj` is one of the values in the list property
`property_name` of the supplied entity
containing_object`.
`property_name` of the supplied entity
`
containing_object`.
If this is the case this function returns. Otherwise the entity is
If this is the case this function returns. Otherwise the entity is
added to the property `property_name` and the entity
added to the property `property_name` and the entity
...
...
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