From 81bfc6dc376a48dcfe92e9dc03aaaa45b207fbc8 Mon Sep 17 00:00:00 2001 From: andrewelamb Date: Fri, 19 Jan 2024 22:10:53 +0000 Subject: [PATCH] fix broken tests --- .../controllers/schema_controller_impl.py | 2 +- .../test_manifest_generation_endpoints.py | 21 ------------------- .../test/test_schema_controller_endpoints.py | 2 +- .../test/test_schema_controller_impl.py | 4 ++-- 4 files changed, 4 insertions(+), 25 deletions(-) diff --git a/apps/schematic/api/schematic_api/controllers/schema_controller_impl.py b/apps/schematic/api/schematic_api/controllers/schema_controller_impl.py index 33b86166d7..f5bbd2c6f9 100644 --- a/apps/schematic/api/schematic_api/controllers/schema_controller_impl.py +++ b/apps/schematic/api/schematic_api/controllers/schema_controller_impl.py @@ -254,7 +254,7 @@ def get_node_properties_from_schematic( node_label (str): The label of the node Returns: - list[NodeProperty]: A list of properties of the node + list[str]: A list of properties of the node """ schema_explorer = SchemaExplorer() schema_explorer.load_schema(schema_url) diff --git a/apps/schematic/api/schematic_api/test/test_manifest_generation_endpoints.py b/apps/schematic/api/schematic_api/test/test_manifest_generation_endpoints.py index b0e800fa42..da72a3b43b 100644 --- a/apps/schematic/api/schematic_api/test/test_manifest_generation_endpoints.py +++ b/apps/schematic/api/schematic_api/test/test_manifest_generation_endpoints.py @@ -6,9 +6,7 @@ from schematic_api.test import BaseTestCase from .conftest import ( - GET_ACCESS_TOKEN_MOCK, CREATE_MANIFESTS_MOCK, - CREATE_SINGLE_MANIFEST_MOCK, TEST_SCHEMA_URL, ) @@ -36,25 +34,6 @@ ] -class TestGenerateExcelManifest(BaseTestCase): - """Tests excel manifest endpoint""" - - def test_success(self) -> None: - """Test for successful result""" - with patch(GET_ACCESS_TOKEN_MOCK): - with patch(CREATE_SINGLE_MANIFEST_MOCK): - url = ( - f"{GENERATE_EXCEL_MANIFEST_URL}" - "&datasetId=syn1" - "&assetViewId=syn2" - "&nodeLabel=node_label" - ) - response = self.client.open(url, method="GET", headers=HEADERS) - self.assert200( - response, f"Response body is : {response.data.decode('utf-8')}" - ) - - class TestGenerateGoogleSheetManifests(BaseTestCase): """Tests google sheet manifest endpoint""" diff --git a/apps/schematic/api/schematic_api/test/test_schema_controller_endpoints.py b/apps/schematic/api/schematic_api/test/test_schema_controller_endpoints.py index 81e45d40ac..8ed7b70a64 100644 --- a/apps/schematic/api/schematic_api/test/test_schema_controller_endpoints.py +++ b/apps/schematic/api/schematic_api/test/test_schema_controller_endpoints.py @@ -17,7 +17,7 @@ NODE_IS_REQUIRED_URL = "/api/v1/nodes/FamilyHistory/isRequired?schemaUrl=" PROPERTY_LABEL_URL = "/api/v1/nodes/node_label/propertyLabel?schemaUrl=" SCHEMA_ATTRIBUTES_URL = "/api/v1/schemaAttributes?schemaUrl=" -NODE_PROPERTY_ARRAY_URL = "/api/v1/nodes/MolecularEntity/nodePropertyArray?schemaUrl=" +NODE_PROPERTY_ARRAY_URL = "/api/v1/nodes/Patient/nodePropertyArray?schemaUrl=" NODE_VALIDATION_RULE_ARRAY_URL = ( "/api/v1/nodes/CheckRegexList/validationRuleArray?schemaUrl=" ) diff --git a/apps/schematic/api/schematic_api/test/test_schema_controller_impl.py b/apps/schematic/api/schematic_api/test/test_schema_controller_impl.py index d692125421..3eb2578290 100644 --- a/apps/schematic/api/schematic_api/test/test_schema_controller_impl.py +++ b/apps/schematic/api/schematic_api/test/test_schema_controller_impl.py @@ -172,7 +172,7 @@ class TestGetNodePropertyArray: def test_success(self, test_schema_url: str) -> None: """Test for successful result""" result, status = get_node_property_array( - node_label="MolecularEntity", + node_label="Patient", schema_url=test_schema_url, ) assert status == 200 @@ -184,7 +184,7 @@ def test_success(self, test_schema_url: str) -> None: def test_internal_error(self) -> None: """Test for 500 result""" result, status = get_node_property_array( - node_label="MolecularEntity", + node_label="Patient", schema_url="not_a_url", ) assert status == 500