diff --git a/poetry.lock b/poetry.lock index 3651701fb..2adf185cb 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1,4 +1,4 @@ -# This file is automatically @generated by Poetry 1.6.1 and should not be changed by hand. +# This file is automatically @generated by Poetry 1.5.1 and should not be changed by hand. [[package]] name = "aiofiles" @@ -952,6 +952,22 @@ files = [ [package.dependencies] pyasn1 = ">=0.1.3" +[[package]] +name = "setuptools" +version = "68.2.2" +description = "Easily download, build, install, upgrade, and uninstall Python packages" +optional = false +python-versions = ">=3.8" +files = [ + {file = "setuptools-68.2.2-py3-none-any.whl", hash = "sha256:b454a35605876da60632df1a60f736524eb73cc47bbc9f3f1ef1b644de74fd2a"}, + {file = "setuptools-68.2.2.tar.gz", hash = "sha256:4ac1475276d2f1c48684874089fefcd83bd7162ddaafb81fac866ba0db282a87"}, +] + +[package.extras] +docs = ["furo", "jaraco.packaging (>=9.3)", "jaraco.tidelift (>=1.4)", "pygments-github-lexers (==0.0.5)", "rst.linker (>=1.9)", "sphinx (>=3.5)", "sphinx-favicon", "sphinx-hoverxref (<2)", "sphinx-inline-tabs", "sphinx-lint", "sphinx-notfound-page (>=1,<2)", "sphinx-reredirects", "sphinxcontrib-towncrier"] +testing = ["build[virtualenv]", "filelock (>=3.4.0)", "flake8-2020", "ini2toml[lite] (>=0.9)", "jaraco.develop (>=7.21)", "jaraco.envs (>=2.2)", "jaraco.path (>=3.2.0)", "pip (>=19.1)", "pytest (>=6)", "pytest-black (>=0.3.7)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=2.2)", "pytest-mypy (>=0.9.1)", "pytest-perf", "pytest-ruff", "pytest-timeout", "pytest-xdist", "tomli-w (>=1.0.0)", "virtualenv (>=13.0.0)", "wheel"] +testing-integration = ["build[virtualenv] (>=1.0.3)", "filelock (>=3.4.0)", "jaraco.envs (>=2.2)", "jaraco.path (>=3.2.0)", "packaging (>=23.1)", "pytest", "pytest-enabler", "pytest-xdist", "tomli", "virtualenv (>=13.0.0)", "wheel"] + [[package]] name = "six" version = "1.16.0" @@ -1051,4 +1067,4 @@ standard = ["colorama (>=0.4)", "httptools (>=0.5.0)", "python-dotenv (>=0.13)", [metadata] lock-version = "2.0" python-versions = "^3.12" -content-hash = "79b04f8cce842989e1202533ccda59b3d3972397b818f6df62d532e61aab03ec" +content-hash = "691162b136ebe00dee8096703a43a468d11fe2f09b5a7953397dc04c8362287e" diff --git a/pyproject.toml b/pyproject.toml index 8056b82d7..01c512fc7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -29,6 +29,7 @@ deepdiff = "^5.8.1" pygments = "^2.16.1" pytest = "^7.4.3" dictdiffer = "^0.9.0" +setuptools = "^68.2.2" [tool.pytest] addopts = ["--ignore gen"] diff --git a/src/home/system/SIMOS/Entity.json b/src/home/system/SIMOS/Entity.json index cc6324e42..f4718d4b3 100644 --- a/src/home/system/SIMOS/Entity.json +++ b/src/home/system/SIMOS/Entity.json @@ -1,8 +1,36 @@ { "name": "Entity", "type": "dmss://system/SIMOS/Blueprint", - "description": "Blueprint for a DMT reference", - "extends": [ - "dmss://system/SIMOS/NamedEntity" + "description": "Blueprint for an entity.", + "attributes": [ + { + "name": "name", + "type": "dmss://system/SIMOS/BlueprintAttribute", + "optional": true, + "attributeType": "string", + "label": "Name" + }, + { + "name": "type", + "type": "dmss://system/SIMOS/BlueprintAttribute", + "attributeType": "string", + "label": "Type", + "default": "", + "optional": false + }, + { + "name": "description", + "type": "dmss://system/SIMOS/BlueprintAttribute", + "attributeType": "string", + "default": "", + "optional": true, + "label": "Description" + }, + { + "name": "_meta_", + "type": "dmss://system/SIMOS/BlueprintAttribute", + "attributeType": "dmss://system/SIMOS/Meta", + "optional": true + } ] } diff --git a/src/home/system/SIMOS/NamedEntity.json b/src/home/system/SIMOS/NamedEntity.json index 9ca4f4e51..e2655e0d6 100644 --- a/src/home/system/SIMOS/NamedEntity.json +++ b/src/home/system/SIMOS/NamedEntity.json @@ -2,6 +2,9 @@ "name": "NamedEntity", "type": "dmss://system/SIMOS/Blueprint", "description": "Blueprint for an entity which MUST have a name", + "extends": [ + "dmss://system/SIMOS/Entity" + ], "attributes": [ { "name": "name", @@ -9,28 +12,6 @@ "optional": false, "attributeType": "string", "label": "Name" - }, - { - "name": "type", - "type": "dmss://system/SIMOS/BlueprintAttribute", - "attributeType": "string", - "label": "Type", - "default": "", - "optional": false - }, - { - "name": "description", - "type": "dmss://system/SIMOS/BlueprintAttribute", - "attributeType": "string", - "default": "", - "optional": true, - "label": "Description" - }, - { - "name": "_meta_", - "type": "dmss://system/SIMOS/BlueprintAttribute", - "attributeType": "dmss://system/SIMOS/Meta", - "optional": true } ] } diff --git a/src/home/system/SIMOS/recipe_links/pdf.json b/src/home/system/SIMOS/recipe_links/pdf.json index 3126d55e6..7f9db4320 100644 --- a/src/home/system/SIMOS/recipe_links/pdf.json +++ b/src/home/system/SIMOS/recipe_links/pdf.json @@ -2,7 +2,7 @@ "type": "dmss://system/SIMOS/RecipeLink", "_blueprintPath_": "dmss://system/SIMOS/blob_types/PDF", "extends": [ - "dmss://system/SIMOS/Entity", + "dmss://system/SIMOS/NamedEntity", "_default_" ], "uiRecipes": [ diff --git a/src/tests/unit/common/entity/validators/test_validate_entity.py b/src/tests/unit/common/entity/validators/test_validate_entity.py index 8d9ec6996..b74eb8bf8 100644 --- a/src/tests/unit/common/entity/validators/test_validate_entity.py +++ b/src/tests/unit/common/entity/validators/test_validate_entity.py @@ -12,6 +12,7 @@ class ValidateEntityTestCase(unittest.TestCase): def setUp(self) -> None: simos_blueprints = [ "dmss://system/SIMOS/Blueprint", + "dmss://system/SIMOS/Entity", "dmss://system/SIMOS/NamedEntity", "dmss://system/SIMOS/BlueprintAttribute", ] diff --git a/src/tests/unit/common/tree/test_tree_node_delete.py b/src/tests/unit/common/tree/test_tree_node_delete.py index 9229f87ce..d64f442f0 100644 --- a/src/tests/unit/common/tree/test_tree_node_delete.py +++ b/src/tests/unit/common/tree/test_tree_node_delete.py @@ -8,7 +8,7 @@ class TreeNodeDeleteTest(unittest.TestCase): def setUp(self) -> None: - simos_blueprints = ["dmss://system/SIMOS/NamedEntity"] + simos_blueprints = ["dmss://system/SIMOS/Entity", "dmss://system/SIMOS/NamedEntity"] mock_blueprint_folder = "src/tests/unit/common/tree/mock_data/mock_blueprints" mock_blueprints_and_file_names = { "Blueprint4": "Blueprint4.blueprint.json", diff --git a/src/tests/unit/common/tree/test_tree_node_from_dict.py b/src/tests/unit/common/tree/test_tree_node_from_dict.py index b0c734f1e..8db38e185 100644 --- a/src/tests/unit/common/tree/test_tree_node_from_dict.py +++ b/src/tests/unit/common/tree/test_tree_node_from_dict.py @@ -21,6 +21,7 @@ class TreeNodeFromDictTestCase(unittest.TestCase): def setUp(self) -> None: simos_blueprints = [ "dmss://system/SIMOS/Reference", + "dmss://system/SIMOS/Entity", "dmss://system/SIMOS/NamedEntity", ] mock_blueprint_folder = "src/tests/unit/common/tree/mock_data/mock_blueprints" diff --git a/src/tests/unit/common/tree/test_tree_node_helpers.py b/src/tests/unit/common/tree/test_tree_node_helpers.py index 58ba5e52a..c1fdcda03 100644 --- a/src/tests/unit/common/tree/test_tree_node_helpers.py +++ b/src/tests/unit/common/tree/test_tree_node_helpers.py @@ -28,6 +28,7 @@ def setUp(self) -> None: ).provider simos_blueprints = [ "dmss://system/SIMOS/Reference", + "dmss://system/SIMOS/Entity", "dmss://system/SIMOS/NamedEntity", ] mock_blueprint_folder = "src/tests/unit/common/tree/mock_data/mock_blueprints" diff --git a/src/tests/unit/common/tree/test_tree_node_to_dict.py b/src/tests/unit/common/tree/test_tree_node_to_dict.py index 4ec8075c8..599cb036b 100644 --- a/src/tests/unit/common/tree/test_tree_node_to_dict.py +++ b/src/tests/unit/common/tree/test_tree_node_to_dict.py @@ -8,7 +8,7 @@ class TreeNodeToDictTestCase(unittest.TestCase): def setUp(self) -> None: - simos_blueprints = ["dmss://system/SIMOS/NamedEntity"] + simos_blueprints = ["dmss://system/SIMOS/NamedEntity", "dmss://system/SIMOS/Entity"] mock_blueprint_folder = "src/tests/unit/common/tree/mock_data/mock_blueprints" mock_blueprints_and_file_names = { "all_contained_cases_blueprint": "all_contained_cases_blueprint.blueprint.json", diff --git a/src/tests/unit/common/tree/test_tree_node_to_ref_dict.py b/src/tests/unit/common/tree/test_tree_node_to_ref_dict.py index c154f238c..e660cc881 100644 --- a/src/tests/unit/common/tree/test_tree_node_to_ref_dict.py +++ b/src/tests/unit/common/tree/test_tree_node_to_ref_dict.py @@ -13,6 +13,7 @@ def setUp(self) -> None: simos_blueprints = [ "dmss://system/SIMOS/Package", "dmss://system/SIMOS/Reference", + "dmss://system/SIMOS/Entity", "dmss://system/SIMOS/NamedEntity", ] mock_blueprint_folder = "src/tests/unit/common/tree/mock_data/mock_blueprints" diff --git a/src/tests/unit/common/tree/test_tree_node_update.py b/src/tests/unit/common/tree/test_tree_node_update.py index 5a14291f4..4284d5862 100644 --- a/src/tests/unit/common/tree/test_tree_node_update.py +++ b/src/tests/unit/common/tree/test_tree_node_update.py @@ -21,6 +21,7 @@ class DocumentServiceTestCase(unittest.TestCase): def setUp(self) -> None: simos_blueprints = [ + "dmss://system/SIMOS/Entity", "dmss://system/SIMOS/NamedEntity", "dmss://system/SIMOS/Reference", "dmss://system/SIMOS/Action", diff --git a/src/tests/unit/services/document_service/mock_blueprints/blob_blueprints/blob.blueprint.json b/src/tests/unit/services/document_service/mock_blueprints/blob_blueprints/blob.blueprint.json index f2b5229b9..96753aadc 100644 --- a/src/tests/unit/services/document_service/mock_blueprints/blob_blueprints/blob.blueprint.json +++ b/src/tests/unit/services/document_service/mock_blueprints/blob_blueprints/blob.blueprint.json @@ -3,7 +3,7 @@ "type": "dmss://system/SIMOS/Blueprint", "description": "Test for a blueprint with storageAffinity in storageRecipe", "extends": [ - "dmss://system/SIMOS/NamedEntity" + "dmss://system/SIMOS/Entity" ], "attributes": [ { diff --git a/src/tests/unit/services/document_service/mock_blueprints/blob_blueprints/uncontained_blueprint.blueprint.json b/src/tests/unit/services/document_service/mock_blueprints/blob_blueprints/uncontained_blueprint.blueprint.json index 5bb0aee05..88222746c 100644 --- a/src/tests/unit/services/document_service/mock_blueprints/blob_blueprints/uncontained_blueprint.blueprint.json +++ b/src/tests/unit/services/document_service/mock_blueprints/blob_blueprints/uncontained_blueprint.blueprint.json @@ -3,7 +3,7 @@ "type": "dmss://system/SIMOS/Blueprint", "description": "uncontained_blueprint", "extends": [ - "dmss://system/SIMOS/NamedEntity" + "dmss://system/SIMOS/Entity" ], "attributes": [ { diff --git a/src/tests/unit/services/document_service/mock_blueprints/people_and_cats/Cat.blueprint.json b/src/tests/unit/services/document_service/mock_blueprints/people_and_cats/Cat.blueprint.json index a57985c0c..2c0afb470 100644 --- a/src/tests/unit/services/document_service/mock_blueprints/people_and_cats/Cat.blueprint.json +++ b/src/tests/unit/services/document_service/mock_blueprints/people_and_cats/Cat.blueprint.json @@ -3,13 +3,13 @@ "type": "dmss://system/SIMOS/Blueprint", "description": "A cat has an owner, but the owner is both storage and model uncontained.", "extends": [ - "dmss://system/SIMOS/NamedEntity" + "dmss://system/SIMOS/Entity" ], "attributes": [ { "name": "owner", "type": "dmss://system/SIMOS/BlueprintAttribute", - "attributeType": "dmss://system/SIMOS/NamedEntity", + "attributeType": "dmss://system/SIMOS/Entity", "contained": false } ] diff --git a/src/tests/unit/services/document_service/mock_blueprints/people_and_cats/CatCage.blueprint.json b/src/tests/unit/services/document_service/mock_blueprints/people_and_cats/CatCage.blueprint.json index 32902dac6..8eea89b51 100644 --- a/src/tests/unit/services/document_service/mock_blueprints/people_and_cats/CatCage.blueprint.json +++ b/src/tests/unit/services/document_service/mock_blueprints/people_and_cats/CatCage.blueprint.json @@ -3,7 +3,7 @@ "type": "dmss://system/SIMOS/Blueprint", "description": "This is a cage that contains a cat. The cat is model and storage contained in the cage. If the cage is removed, so is the cat.", "extends": [ - "dmss://system/SIMOS/NamedEntity" + "dmss://system/SIMOS/Entity" ], "attributes": [ { diff --git a/src/tests/unit/services/document_service/mock_blueprints/people_and_cats/CoupleOfPeople.blueprint.json b/src/tests/unit/services/document_service/mock_blueprints/people_and_cats/CoupleOfPeople.blueprint.json index a27382390..32b8d6810 100644 --- a/src/tests/unit/services/document_service/mock_blueprints/people_and_cats/CoupleOfPeople.blueprint.json +++ b/src/tests/unit/services/document_service/mock_blueprints/people_and_cats/CoupleOfPeople.blueprint.json @@ -3,7 +3,7 @@ "type": "dmss://system/SIMOS/Blueprint", "description": "Two People ", "extends": [ - "dmss://system/SIMOS/NamedEntity" + "dmss://system/SIMOS/Entity" ], "attributes": [ { diff --git a/src/tests/unit/services/document_service/mock_blueprints/people_and_cats/Person.blueprint.json b/src/tests/unit/services/document_service/mock_blueprints/people_and_cats/Person.blueprint.json index d43487db9..d2518f7fd 100644 --- a/src/tests/unit/services/document_service/mock_blueprints/people_and_cats/Person.blueprint.json +++ b/src/tests/unit/services/document_service/mock_blueprints/people_and_cats/Person.blueprint.json @@ -3,23 +3,23 @@ "type": "dmss://system/SIMOS/Blueprint", "description": "This blueprint has attributes for all the possible cases of storage uncontained. This is set in the storage recipe, that ", "extends": [ - "dmss://system/SIMOS/NamedEntity" + "dmss://system/SIMOS/Entity" ], "attributes": [ { "name": "containedPersonInfo", "type": "dmss://system/SIMOS/BlueprintAttribute", - "attributeType": "dmss://system/SIMOS/NamedEntity" + "attributeType": "dmss://system/SIMOS/Entity" }, { "name": "storageUncontainedBestFriend", "type": "dmss://system/SIMOS/BlueprintAttribute", - "attributeType": "dmss://system/SIMOS/NamedEntity" + "attributeType": "dmss://system/SIMOS/Entity" }, { "name": "storageUncontainedListOfFriends", "type": "dmss://system/SIMOS/BlueprintAttribute", - "attributeType": "dmss://system/SIMOS/NamedEntity", + "attributeType": "dmss://system/SIMOS/Entity", "dimensions": "*" }, { diff --git a/src/tests/unit/services/document_service/test_data_source_and_repositories.py b/src/tests/unit/services/document_service/test_data_source_and_repositories.py index afff9a504..a61c1e92d 100644 --- a/src/tests/unit/services/document_service/test_data_source_and_repositories.py +++ b/src/tests/unit/services/document_service/test_data_source_and_repositories.py @@ -17,7 +17,7 @@ class DataSourceTestCase(unittest.TestCase): def setUp(self) -> None: - simos_blueprints = ["dmss://system/SIMOS/NamedEntity"] + simos_blueprints = ["dmss://system/SIMOS/Entity", "dmss://system/SIMOS/NamedEntity"] mock_blueprint_folder = "src/tests/unit/services/document_service/mock_blueprints/blob_blueprints" mock_blueprints_and_file_names = { "blobContainer": "blobContainer.blueprint.json", diff --git a/src/tests/unit/services/document_service/test_document_service_get_document.py b/src/tests/unit/services/document_service/test_document_service_get_document.py index 852c36475..22704c4e9 100644 --- a/src/tests/unit/services/document_service/test_document_service_get_document.py +++ b/src/tests/unit/services/document_service/test_document_service_get_document.py @@ -68,6 +68,7 @@ def setUp(self): self.document_repository.find = self.mock_find simos_blueprints = [ + "dmss://system/SIMOS/Entity", "dmss://system/SIMOS/NamedEntity", "dmss://system/SIMOS/Reference", ] diff --git a/src/tests/unit/services/document_service/test_get_extended_blueprint.py b/src/tests/unit/services/document_service/test_get_extended_blueprint.py index 382b79b0a..2b5382876 100644 --- a/src/tests/unit/services/document_service/test_get_extended_blueprint.py +++ b/src/tests/unit/services/document_service/test_get_extended_blueprint.py @@ -11,7 +11,7 @@ class GetExtendedBlueprintTestCase(unittest.TestCase): def setUp(self): - simos_blueprints = ["dmss://system/SIMOS/NamedEntity"] + simos_blueprints = ["dmss://system/SIMOS/Entity", "dmss://system/SIMOS/NamedEntity"] mock_blueprint_folder = "src/tests/unit/services/document_service/mock_blueprints/extended_blueprints" mock_blueprints_and_file_names = { "SecondLevelExtendedBlueprint": "SecondLevelExtendedBlueprint.blueprint.json", diff --git a/src/tests/unit/services/document_service/test_reference_resolve.py b/src/tests/unit/services/document_service/test_reference_resolve.py index b5b863671..19946a443 100644 --- a/src/tests/unit/services/document_service/test_reference_resolve.py +++ b/src/tests/unit/services/document_service/test_reference_resolve.py @@ -16,6 +16,7 @@ class GetDocumentResolveTestCase(unittest.TestCase): def setUp(self) -> None: simos_blueprints = [ "dmss://system/SIMOS/Package", + "dmss://system/SIMOS/Entity", "dmss://system/SIMOS/NamedEntity", ] mock_blueprint_folder = "src/tests/unit/services/document_service/mock_blueprints/car_rental_blueprints" diff --git a/src/tests/unit/services/document_service/test_remove.py b/src/tests/unit/services/document_service/test_remove.py index 3d8caaf83..8918441fb 100644 --- a/src/tests/unit/services/document_service/test_remove.py +++ b/src/tests/unit/services/document_service/test_remove.py @@ -25,13 +25,14 @@ def mock_find(target: dict): "_id": "2", "name": "", "description": "", - "type": "dmss://system/SIMOS/NamedEntity", + "type": "dmss://system/SIMOS/Entity", } ] self.repository.find = mock_find simos_blueprints = [ + "dmss://system/SIMOS/Entity", "dmss://system/SIMOS/NamedEntity", "dmss://system/SIMOS/Reference", "dmss://system/SIMOS/Blob", @@ -66,7 +67,7 @@ def test_remove_document_removes_document_with_correct_id(self): document_1 = { "_id": "1", "name": "simple", - "type": "dmss://system/SIMOS/NamedEntity", + "type": "dmss://system/SIMOS/Entity", } document_repository.get = lambda id: document_1.copy() @@ -94,14 +95,14 @@ def test_remove_document_with_model_and_storage_uncontained_children(self): "owner": { "_id": "2", "name": "a_reference", - "type": "dmss://system/SIMOS/NamedEntity", + "type": "dmss://system/SIMOS/Entity", }, } doc_2 = { "uid": "2", "_id": "2", "name": "a_reference", - "type": "dmss://system/SIMOS/NamedEntity", + "type": "dmss://system/SIMOS/Entity", } self.storage = {"1": doc_1, "2": doc_2} @@ -123,7 +124,7 @@ def test_remove_required_child_dict_raises_ValidationException(self): "2": { "name": "Mary", "description": "", - "type": "dmss://system/SIMOS/NamedEntity", + "type": "dmss://system/SIMOS/Entity", }, } @@ -138,7 +139,7 @@ def test_remove_required_primitive_attribute_raises_NotFoundException(self): "1": { "_id": "1", "name": "", - "type": "dmss://system/SIMOS/NamedEntity", + "type": "dmss://system/SIMOS/Entity", "description": "", } } @@ -166,7 +167,7 @@ def test_remove_required_child_list_raises_ValidationException(self): "2": { "name": "", "description": "", - "type": "dmss://system/SIMOS/NamedEntity", + "type": "dmss://system/SIMOS/Entity", }, } @@ -233,12 +234,12 @@ def test_remove_document_also_removes_storage_uncontained_grand_children(self): "2": { "_id": "2", "name": "Mary", - "type": "dmss://system/SIMOS/NamedEntity", + "type": "dmss://system/SIMOS/Entity", }, "3": { "_id": "3", "name": "Lisa", - "type": "dmss://system/SIMOS/NamedEntity", + "type": "dmss://system/SIMOS/Entity", }, } @@ -259,7 +260,7 @@ def test_remove_required_reference_raises_ValidationException(self): "referenceType": REFERENCE_TYPES.LINK.value, }, }, - "2": {"_id": "2", "name": "Mary", "type": "dmss://system/SIMOS/NamedEntity"}, + "2": {"_id": "2", "name": "Mary", "type": "dmss://system/SIMOS/Entity"}, } self.assertRaises( @@ -276,7 +277,7 @@ def test_remove_optional_attribute_is_removed_successfully(self): "type": "PersonImage", "optionalImageText": { "name": "imageText", - "type": "dmss://system/SIMOS/NamedEntity", + "type": "dmss://system/SIMOS/Entity", "description": "This is my image text", }, } diff --git a/src/tests/unit/services/document_service/test_save.py b/src/tests/unit/services/document_service/test_save.py index 950bc52ef..82bfc44b0 100644 --- a/src/tests/unit/services/document_service/test_save.py +++ b/src/tests/unit/services/document_service/test_save.py @@ -18,7 +18,7 @@ class DocumentServiceTestCase(unittest.TestCase): def setUp(self) -> None: simos_blueprints = [ - "dmss://system/SIMOS/NamedEntity", + "dmss://system/SIMOS/Entity", "dmss://system/SIMOS/Reference", ] mock_blueprint_folder = "src/tests/unit/services/document_service/mock_blueprints/people_and_cats" @@ -52,37 +52,37 @@ def test_save_update(self): "type": "Person", "containedPersonInfo": { "name": "", - "type": "dmss://system/SIMOS/NamedEntity", + "type": "dmss://system/SIMOS/Entity", }, "storageUncontainedBestFriend": { "_id": "2", "name": "a_reference", - "type": "dmss://system/SIMOS/NamedEntity", + "type": "dmss://system/SIMOS/Entity", }, "storageUncontainedListOfFriends": [ { "_id": "3", "name": "ref1", - "type": "dmss://system/SIMOS/NamedEntity", + "type": "dmss://system/SIMOS/Entity", }, { "_id": "4", "name": "ref2", - "type": "dmss://system/SIMOS/NamedEntity", + "type": "dmss://system/SIMOS/Entity", }, ], }, "2": { "_id": "2", "name": "a_reference", - "type": "dmss://system/SIMOS/NamedEntity", + "type": "dmss://system/SIMOS/Entity", }, - "3": {"_id": "3", "name": "ref1", "type": "dmss://system/SIMOS/NamedEntity"}, + "3": {"_id": "3", "name": "ref1", "type": "dmss://system/SIMOS/Entity"}, "4": { "_id": "4", "name": "ref2", "description": "TEST", - "type": "dmss://system/SIMOS/NamedEntity", + "type": "dmss://system/SIMOS/Entity", }, } @@ -104,7 +104,7 @@ def mock_update(entity: dict, *args, **kwargs): "_id": "4", "name": "ref2", "description": "TEST_MODIFY", - "type": "dmss://system/SIMOS/NamedEntity", + "type": "dmss://system/SIMOS/Entity", } ) for sub_node in node.traverse(): @@ -115,7 +115,7 @@ def mock_update(entity: dict, *args, **kwargs): "_id": "4", "name": "ref2", "description": "TEST_MODIFY", - "type": "dmss://system/SIMOS/NamedEntity", + "type": "dmss://system/SIMOS/Entity", } def test_save_update_attribute(self): @@ -128,7 +128,7 @@ def test_save_update_attribute(self): "type": "Person", "containedPersonInfo": { "name": "", - "type": "dmss://system/SIMOS/NamedEntity", + "type": "dmss://system/SIMOS/Entity", }, } } @@ -149,7 +149,7 @@ def mock_update(entity: dict, *args, **kwargs): { "name": "RENAMED", "description": "TEST_MODIFY", - "type": "dmss://system/SIMOS/NamedEntity", + "type": "dmss://system/SIMOS/Entity", } ) self.mock_document_service.save(contained_node, "testing", initial=True) @@ -166,15 +166,15 @@ def test_save_append(self): "type": "Person", "containedPersonInfo": { "name": "JohnInfo", - "type": "dmss://system/SIMOS/NamedEntity", + "type": "dmss://system/SIMOS/Entity", }, "storageUncontainedBestFriend": { "name": "Peter", - "type": "dmss://system/SIMOS/NamedEntity", + "type": "dmss://system/SIMOS/Entity", }, "storageUncontainedListOfFriends": [], }, - "2": {"_id": "2", "name": "Mary", "type": "dmss://system/SIMOS/NamedEntity"}, + "2": {"_id": "2", "name": "Mary", "type": "dmss://system/SIMOS/Entity"}, } def mock_get(document_id: str): @@ -199,7 +199,7 @@ def mock_update(entity: dict, *args, **kwargs): blueprint_provider=self.mock_document_service.get_blueprint, attribute=BlueprintAttribute( name="storageUncontainedListOfFriends", - attribute_type="dmss://system/SIMOS/NamedEntity", + attribute_type="dmss://system/SIMOS/Entity", ), ) ) @@ -223,7 +223,7 @@ def test_save_delete(self): "type": "Person", "containedPersonInfo": { "name": "Nested", - "type": "dmss://system/SIMOS/NamedEntity", + "type": "dmss://system/SIMOS/Entity", }, "storageUncontainedBestFriend": { "address": "$5", @@ -252,24 +252,24 @@ def test_save_delete(self): "_id": "2", "name": "Gina", "description": "Index 1", - "type": "dmss://system/SIMOS/NamedEntity", + "type": "dmss://system/SIMOS/Entity", }, "3": { "_id": "3", "name": "Lisa", "description": "Index 2", - "type": "dmss://system/SIMOS/NamedEntity", + "type": "dmss://system/SIMOS/Entity", }, "4": { "_id": "4", "name": "Patricia", "description": "Index 3", - "type": "dmss://system/SIMOS/NamedEntity", + "type": "dmss://system/SIMOS/Entity", }, "5": { "_id": "5", "name": "Mary", - "type": "dmss://system/SIMOS/NamedEntity", + "type": "dmss://system/SIMOS/Entity", }, } @@ -329,13 +329,13 @@ def test_save_nested_uncontained(self): "2": { "_id": "2", "name": "John", - "type": "dmss://system/SIMOS/NamedEntity", + "type": "dmss://system/SIMOS/Entity", "description": "I am a cat owner, storage and model uncontained by my cat.", }, "3": { "_id": "3", "name": "Lisa", - "type": "dmss://system/SIMOS/NamedEntity", + "type": "dmss://system/SIMOS/Entity", "description": "Lisa loves cats, and will take over as owner for John's cat, Garfield", }, } @@ -387,7 +387,7 @@ def test_save_no_overwrite_uncontained_document(self): owner = { "_id": "2", "name": "owner", - "type": "dmss://system/SIMOS/NamedEntity", + "type": "dmss://system/SIMOS/Entity", "description": "I'm an owner for a cat. Model and storage uncontained from cat.", } @@ -434,12 +434,12 @@ def test_save_update_children_of_contained_attribute(self): "storageUncontainedBestFriend": { "_id": "2", "name": "Lisa", - "type": "dmss://system/SIMOS/NamedEntity", + "type": "dmss://system/SIMOS/Entity", }, }, "b": {}, }, - "2": {"_id": "2", "name": "Lisa", "type": "dmss://system/SIMOS/NamedEntity"}, + "2": {"_id": "2", "name": "Lisa", "type": "dmss://system/SIMOS/Entity"}, "3": {"_id": "3", "description": " This is malformed, with missing type"}, } @@ -461,7 +461,7 @@ def mock_update(entity: dict, *args, **kwargs): "storageUncontainedBestFriend": { "_id": "2", "name": "a_reference", - "type": "dmss://system/SIMOS/NamedEntity", + "type": "dmss://system/SIMOS/Entity", "description": "A NEW DESCRIPTION HERE", }, "containedPersonInfo": {}, diff --git a/src/tests/unit/services/document_service/test_update_document_complex_arrays.py b/src/tests/unit/services/document_service/test_update_document_complex_arrays.py index 672542968..37021b8b1 100644 --- a/src/tests/unit/services/document_service/test_update_document_complex_arrays.py +++ b/src/tests/unit/services/document_service/test_update_document_complex_arrays.py @@ -14,7 +14,7 @@ class ArraysDocumentServiceTestCase(unittest.TestCase): def setUp(self) -> None: - simos_blueprints = ["dmss://system/SIMOS/NamedEntity"] + simos_blueprints = ["dmss://system/SIMOS/Entity", "dmss://system/SIMOS/NamedEntity"] mock_blueprint_folder = "src/tests/unit/services/document_service/mock_blueprints/arrays" mock_blueprints_and_file_names = { "basic": "basic.blueprint.json", diff --git a/src/tests/unit/use_cases/add_document/test_add_reference.py b/src/tests/unit/use_cases/add_document/test_add_reference.py index 508acccf6..f7d639710 100644 --- a/src/tests/unit/use_cases/add_document/test_add_reference.py +++ b/src/tests/unit/use_cases/add_document/test_add_reference.py @@ -17,6 +17,7 @@ class ReferenceTestCase(unittest.TestCase): def setUp(self) -> None: simos_blueprints = [ + "dmss://system/SIMOS/Entity", "dmss://system/SIMOS/NamedEntity", "dmss://system/SIMOS/Reference", ] diff --git a/src/tests/unit/use_cases/check_existance/test_check_existence.py b/src/tests/unit/use_cases/check_existance/test_check_existence.py index 15244f406..8c30b9d59 100644 --- a/src/tests/unit/use_cases/check_existance/test_check_existence.py +++ b/src/tests/unit/use_cases/check_existance/test_check_existence.py @@ -15,7 +15,7 @@ def setUp(self) -> None: self.storage = { "1": { "name": "Test_document", - "type": "dmss://system/SIMOS/NamedEntity", + "type": "dmss://system/SIMOS/Entity", "_id": "1", } } @@ -23,7 +23,7 @@ def setUp(self) -> None: self.repository.get = self.mock_get self.repository.delete = self.mock_delete - simos_blueprints = ["dmss://system/SIMOS/NamedEntity"] + simos_blueprints = ["dmss://system/SIMOS/Entity"] mock_blueprint_provider = MockBlueprintProvider( mock_blueprints_and_file_names={}, mock_blueprint_folder="", diff --git a/src/tests/unit/use_cases/instantiate_entity_use_case/test_create_entity.py b/src/tests/unit/use_cases/instantiate_entity_use_case/test_create_entity.py index d41b1a7f9..e8a68abc7 100644 --- a/src/tests/unit/use_cases/instantiate_entity_use_case/test_create_entity.py +++ b/src/tests/unit/use_cases/instantiate_entity_use_case/test_create_entity.py @@ -13,6 +13,7 @@ def setUp(self): simos_blueprints = [ "dmss://system/SIMOS/AttributeTypes", "dmss://system/SIMOS/BlueprintAttribute", + "dmss://system/SIMOS/Entity", "dmss://system/SIMOS/NamedEntity", ] mock_blueprint_folder = "src/tests/unit/use_cases/instantiate_entity_use_case/mock_data/"