Skip to content
Snippets Groups Projects
Commit 619c25e6 authored by Florian Spreckelsen's avatar Florian Spreckelsen
Browse files

Merge branch 'dev' into f-extend-yaml-model

parents 87dd3224 0b26273c
No related branches found
No related tags found
2 merge requests!39Release 0.4.0,!36Revert "Revert "Merge branch 'f-extend-yaml-model' into 'dev'""
Pipeline #20227 failed
......@@ -64,6 +64,7 @@ test:
- rc=`cat .docker/result`
- exit $rc
dependencies: [cert]
needs: [cert]
artifacts:
paths:
- caosdb_log.txt
......@@ -95,6 +96,7 @@ cert:
tags: [docker]
stage: cert
image: $CI_REGISTRY_IMAGE
needs: [build-testenv]
artifacts:
paths:
- .docker/cert/
......@@ -106,6 +108,7 @@ style:
tags: [docker]
stage: style
image: $CI_REGISTRY_IMAGE
needs: []
script:
- make style
allow_failure: true
......@@ -114,6 +117,7 @@ unittest:
tags: [docker]
stage: unittest
image: $CI_REGISTRY_IMAGE
needs: []
script:
- tox
......
......@@ -48,7 +48,8 @@ Optional h5-crawler:
`integrationtest/extroot/` directory.
## Code Formatting
`autopep8 -i -r ./`
`make style`
## Documentation #
......
......@@ -32,26 +32,25 @@ from caosadvancedtools.cfood import (assure_object_is_in_list)
from caosadvancedtools.guard import (global_guard, RETRIEVE, UPDATE)
def setup_module():
def setup():
"""Delete all test entities."""
db.execute_query("FIND Test*").delete(raise_exception_on_error=False)
def setup():
def setup_module():
"""Allow all updates and delete test data"""
global_guard.level = UPDATE
setup_module()
setup()
def teardown():
def teardown_module():
"""Reset guard level and delete test data."""
global_guard.level = RETRIEVE
setup_module()
setup()
def test_assure_list_in_place():
"""Test an in-place update with `assure_object_is_in_list`."""
int_list_prop = db.Property(name="TestIntListProperty",
datatype=db.LIST(db.INTEGER)).insert()
rt1 = db.RecordType(name="TestType1").add_property(
......
......@@ -23,6 +23,7 @@
# ** end header
#
import caosdb as db
import pytest
from caosadvancedtools import table_export as te
......@@ -85,8 +86,11 @@ def setup_module():
pass
@pytest.fixture(autouse=True)
def setup():
"""No further setup"""
"""Same as module setup."""
setup_module()
yield None
setup_module()
......
......@@ -20,10 +20,11 @@
# along with this program. If not, see <https://www.gnu.org/licenses/>.
#
# ** end header
"""Test whether the crawler correctly identifies the data model
problems caused by a faulty model.
"""Test whether the crawler correctly identifies the data model problems caused by a faulty model.
"""
import caosdb as db
from caosadvancedtools import loadFiles
from caosadvancedtools.cfood import fileguide
......
......@@ -44,12 +44,15 @@ def setup_module():
print(delete_exc)
@pytest.fixture(autouse=True)
def setup():
"""No further setup"""
"""Same as module setup."""
setup_module()
yield None
setup_module()
def teardown():
def teardown_module():
"""Clear and delete again."""
setup_module()
......
......@@ -154,10 +154,10 @@ def setup_package():
long_description_content_type="text/markdown",
author='Henrik tom Wörden',
author_email='h.tomwoerden@indiscale.com',
install_requires=["caosdb>=0.6.0",
install_requires=["caosdb>=0.7.0",
"numpy>=1.17.3",
"openpyxl>=3.0.0",
"pandas>=1.2.0",
"numpy>=1.17.3",
"xlrd>=2.0",
],
extras_require={"h5-crawler": ["h5py>=3.3.0", ],
......
......@@ -391,7 +391,7 @@ class AbstractFileCFood(AbstractCFood):
def assure_object_is_in_list(obj, containing_object, property_name,
to_be_updated=None, datatype=None):
"""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
added to the property `property_name` and the entity
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment