diff --git a/README_SETUP.md b/README_SETUP.md index 09a368a3d33f9fb2be799a5ba9961d293a2fd6c3..d33316612c1d2870c3b2c416e842df4220ecf858 100644 --- a/README_SETUP.md +++ b/README_SETUP.md @@ -48,7 +48,8 @@ Optional h5-crawler: `integrationtest/extroot/` directory. ## Code Formatting -`autopep8 -i -r ./` + +`make style` ## Documentation # diff --git a/integrationtests/test_assure_functions.py b/integrationtests/test_assure_functions.py index 56f9767a0f436201ab6003ffd88f631bdb089544..9f4e387d52f25382d18cfb21372a06346d2b5465 100644 --- a/integrationtests/test_assure_functions.py +++ b/integrationtests/test_assure_functions.py @@ -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( diff --git a/src/caosadvancedtools/cfood.py b/src/caosadvancedtools/cfood.py index 2c56e171d8e70789bc4f0dd3881a7d8e716e75f7..3c2d5408ef4d857f62ce4e908f90c4ffccef4d19 100644 --- a/src/caosadvancedtools/cfood.py +++ b/src/caosadvancedtools/cfood.py @@ -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