From 97e8ca3e1bf88477514522af5b65c007b36b1bc9 Mon Sep 17 00:00:00 2001 From: abhilash-kumar-nair Date: Sat, 2 May 2026 17:21:58 +0530 Subject: [PATCH 1/2] feat: add add_dependencies method to Workspace --- modelon/impact/client/entities/workspace.py | 51 +++++++++++++++++++++ 1 file changed, 51 insertions(+) diff --git a/modelon/impact/client/entities/workspace.py b/modelon/impact/client/entities/workspace.py index 12e9cc72..f30f00f8 100644 --- a/modelon/impact/client/entities/workspace.py +++ b/modelon/impact/client/entities/workspace.py @@ -1089,6 +1089,57 @@ def get_dependencies( for item in resp["data"]["items"] ] + def add_dependencies(self, dependencies: List[Project]) -> None: + """Add projects as dependencies to the workspace. + + If an existing dependency has the same name as a project being added, + the existing entry is disabled to satisfy the constraint that a workspace + cannot have multiple enabled projects with the same name. + + Args: + dependencies: A list of Project objects to add as dependencies. + + Example:: + + project = client.get_project('my-project-id') + workspace.add_dependencies([project]) + + """ + workspace_data = self._sal.workspace.workspace_get( + workspace_id=self.id, size_info=False + ) + + existing_deps_resp = self._sal.workspace.dependencies_get( + self._workspace_id, vcs_info=False, include_disabled=True + ) + existing_projects_resp = self._sal.workspace.projects_get( + self._workspace_id, vcs_info=False, include_disabled=True + ) + id_to_name = { + item["id"]: item["definition"]["name"] + for item in ( + existing_deps_resp["data"]["items"] + + existing_projects_resp["data"]["items"] + ) + } + + new_project_names = {project.id: project.name for project in dependencies} + + for list_key in ("dependencies", "projects"): + current_entries = workspace_data["definition"].setdefault(list_key, []) + for entry in current_entries: + entry_project_id = entry.get("reference", {}).get("id") + entry_name = id_to_name.get(entry_project_id) + if entry_name and entry_name in new_project_names.values(): + entry["disabled"] = True + + current_entries = workspace_data["definition"].setdefault("dependencies", []) + + for project in dependencies: + current_entries.append({"reference": {"id": project.id}}) + + self._sal.workspace.update_workspace(self.id, workspace_data) + def create_project(self, name: str) -> Project: """Creates a new project in the workspace. From 9f348d584992e81a528e34d93d5b8de82500f6c6 Mon Sep 17 00:00:00 2001 From: abhilash-kumar-nair Date: Thu, 21 May 2026 11:20:30 +0530 Subject: [PATCH 2/2] chore: added test for add_dependencies method --- .../TestWorkspace.test_add_dependencies.yaml | 892 ++++++++++++++++++ ...isables_existing_entry_with_same_name.yaml | 892 ++++++++++++++++++ .../impact/client/entities/test_workspace.py | 19 + 3 files changed, 1803 insertions(+) create mode 100644 tests/fixtures/vcr_cassettes/test_workspace/TestWorkspace.test_add_dependencies.yaml create mode 100644 tests/fixtures/vcr_cassettes/test_workspace/TestWorkspace.test_add_dependencies_disables_existing_entry_with_same_name.yaml diff --git a/tests/fixtures/vcr_cassettes/test_workspace/TestWorkspace.test_add_dependencies.yaml b/tests/fixtures/vcr_cassettes/test_workspace/TestWorkspace.test_add_dependencies.yaml new file mode 100644 index 00000000..471737b6 --- /dev/null +++ b/tests/fixtures/vcr_cassettes/test_workspace/TestWorkspace.test_add_dependencies.yaml @@ -0,0 +1,892 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + method: GET + uri: /hub/api/ + response: + body: + string: '{"version": "5.3.0"}' + headers: + Connection: + - keep-alive + Content-Type: + - application/json + access-control-allow-headers: + - accept, content-type, authorization + access-control-allow-origin: + - '*' + x-jupyterhub-version: + - 5.3.0 + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + method: GET + uri: /hub/api/ + response: + body: + string: '{"version": "5.3.0"}' + headers: + Connection: + - keep-alive + Content-Type: + - application/json + access-control-allow-headers: + - accept, content-type, authorization + access-control-allow-origin: + - '*' + x-jupyterhub-version: + - 5.3.0 + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + method: GET + uri: /hub/api/user + response: + body: + string: '{"name": "test-user-uniqid", "server": "/user/test-user-uniqid/"}' + headers: + Connection: + - keep-alive + Content-Type: + - application/json + access-control-allow-headers: + - accept, content-type, authorization + x-jupyterhub-version: + - 5.3.0 + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + method: GET + uri: /user/test-user-uniqid/impact/api/users/me + response: + body: + string: '{"data": {"id": "test-user-uniqid", "username": "test-user", "firstName": + null, "lastName": null, "email": "test-user@modelon.com", "license": "impact-pro", + "roles": ["impact-editor", "offline_access", "impact-viewer", "uma_authorization", + "default-roles-modelon", "impact-pro", "impact-executor", "impact-workspace-publisher"], + "tenant": {"id": "org1", "groupName": "impact-tenant-org1"}}}' + headers: + Connection: + - keep-alive + Content-Type: + - application/json + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + method: GET + uri: /user/test-user-uniqid/impact/api/ + response: + body: + string: '{"version": "4.28.0"}' + headers: + Connection: + - keep-alive + Content-Type: + - application/json + Transfer-Encoding: + - chunked + content-length: + - '21' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + method: GET + uri: /user/test-user-uniqid/impact/api/users/me + response: + body: + string: '{"data": {"id": "test-user-uniqid", "username": "test-user", "firstName": + null, "lastName": null, "email": "test-user@modelon.com", "license": "impact-pro", + "roles": ["impact-editor", "offline_access", "impact-viewer", "uma_authorization", + "default-roles-modelon", "impact-pro", "impact-executor", "impact-workspace-publisher"], + "tenant": {"id": "org1", "groupName": "impact-tenant-org1"}}}' + headers: + Connection: + - keep-alive + Content-Type: + - application/json + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + method: GET + uri: /user/test-user-uniqid/impact/api/workspaces + response: + body: + string: '{"data": {"items": [{"definition": {"name": "test", "description": + "", "defaultProjectId": "fe964271cbc1f5c5739e3b4e485ed329fd862a77", "projects": + [{"reference": {"id": "fe964271cbc1f5c5739e3b4e485ed329fd862a77"}, "disabled": + false, "disabledContent": []}], "dependencies": [{"reference": {"id": "fec43f77925949bd7e7c0f10ac49ebc1189dc840", + "name": "Modelica", "version": "3.2.3"}, "disabled": true, "disabledContent": + []}, {"reference": {"id": "ac04a5da97bc2e11bffb7f41b2485da347846df6", "name": + "Modelica", "version": "4.0.0"}, "disabled": true, "disabledContent": []}, + {"reference": {"id": "03a291276bb1f38120a5d4d2c4068a2d3d286274", "name": "Modelica", + "version": "4.1.0"}, "disabled": false, "disabledContent": []}], "format": + "1.0.0", "guid": "a81ae267561f455c98bc6710c23176f9", "createdBy": "test-user-uniqid", + "createdAt": 1779271558352}, "id": "test", "conversion": {"state": "UP_TO_DATE"}}]}}' + headers: + Connection: + - keep-alive + Content-Type: + - application/json + Transfer-Encoding: + - chunked + content-length: + - '921' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + method: GET + uri: /user/test-user-uniqid/impact/api/workspaces/test + response: + body: + string: '{"definition": {"name": "test", "description": "", "defaultProjectId": + "fe964271cbc1f5c5739e3b4e485ed329fd862a77", "projects": [{"reference": {"id": + "fe964271cbc1f5c5739e3b4e485ed329fd862a77"}, "disabled": false, "disabledContent": + []}], "dependencies": [{"reference": {"id": "fec43f77925949bd7e7c0f10ac49ebc1189dc840", + "name": "Modelica", "version": "3.2.3"}, "disabled": true, "disabledContent": + []}, {"reference": {"id": "ac04a5da97bc2e11bffb7f41b2485da347846df6", "name": + "Modelica", "version": "4.0.0"}, "disabled": true, "disabledContent": []}, + {"reference": {"id": "03a291276bb1f38120a5d4d2c4068a2d3d286274", "name": "Modelica", + "version": "4.1.0"}, "disabled": false, "disabledContent": []}], "format": + "1.0.0", "guid": "a81ae267561f455c98bc6710c23176f9", "createdBy": "test-user-uniqid", + "createdAt": 1779271558352}, "id": "test", "conversion": {"state": "UP_TO_DATE"}}' + headers: + Connection: + - keep-alive + Content-Type: + - application/json + Transfer-Encoding: + - chunked + content-length: + - '898' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + method: GET + uri: /user/test-user-uniqid/impact/api/workspaces/test + response: + body: + string: '{"definition": {"name": "test", "description": "", "defaultProjectId": + "fe964271cbc1f5c5739e3b4e485ed329fd862a77", "projects": [{"reference": {"id": + "fe964271cbc1f5c5739e3b4e485ed329fd862a77"}, "disabled": false, "disabledContent": + []}], "dependencies": [{"reference": {"id": "fec43f77925949bd7e7c0f10ac49ebc1189dc840", + "name": "Modelica", "version": "3.2.3"}, "disabled": true, "disabledContent": + []}, {"reference": {"id": "ac04a5da97bc2e11bffb7f41b2485da347846df6", "name": + "Modelica", "version": "4.0.0"}, "disabled": true, "disabledContent": []}, + {"reference": {"id": "03a291276bb1f38120a5d4d2c4068a2d3d286274", "name": "Modelica", + "version": "4.1.0"}, "disabled": false, "disabledContent": []}], "format": + "1.0.0", "guid": "a81ae267561f455c98bc6710c23176f9", "createdBy": "test-user-uniqid", + "createdAt": 1779271558352}, "id": "test", "conversion": {"state": "UP_TO_DATE"}}' + headers: + Connection: + - keep-alive + Content-Type: + - application/json + Transfer-Encoding: + - chunked + content-length: + - '898' + status: + code: 200 + message: OK +- request: + body: '{"new": {"name": "impact-python-client-workspace1"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '52' + Content-Type: + - application/json + method: POST + uri: /user/test-user-uniqid/impact/api/workspaces + response: + body: + string: '{"definition": {"name": "impact-python-client-workspace1", "description": + "", "defaultProjectId": "46e51f746c53db674d0d71cdcc7a085f81d7c3c9", "projects": + [{"reference": {"id": "46e51f746c53db674d0d71cdcc7a085f81d7c3c9"}, "disabled": + false, "disabledContent": []}], "dependencies": [{"reference": {"id": "fec43f77925949bd7e7c0f10ac49ebc1189dc840", + "name": "Modelica", "version": "3.2.3"}, "disabled": true, "disabledContent": + []}, {"reference": {"id": "ac04a5da97bc2e11bffb7f41b2485da347846df6", "name": + "Modelica", "version": "4.0.0"}, "disabled": true, "disabledContent": []}, + {"reference": {"id": "03a291276bb1f38120a5d4d2c4068a2d3d286274", "name": "Modelica", + "version": "4.1.0"}, "disabled": false, "disabledContent": []}], "format": + "1.0.0", "guid": "4bceceb852704a6382d916e36ea625b0", "createdBy": "test-user-uniqid", + "createdAt": 1779342357536}, "id": "impact-python-client-workspace1", "conversion": + {"state": "UP_TO_DATE"}}' + headers: + Connection: + - keep-alive + Content-Type: + - application/json + Transfer-Encoding: + - chunked + content-length: + - '952' + status: + code: 200 + message: OK +- request: + body: '{"new": {"name": "Project1"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '29' + Content-Type: + - application/json + method: POST + uri: /user/test-user-uniqid/impact/api/workspaces/impact-python-client-workspace1/projects + response: + body: + string: '{"id": "945dc27b4abb5ec2c802d47abb50ba8c993c287a", "definition": {"name": + "Project1", "format": "1.0.0", "dependencies": [{"name": "Modelica", "versionSpecifier": + "4.1.0"}], "content": [{"relpath": "Resources/Views", "contentType": "VIEWS", + "defaultDisabled": false, "id": "c78da39287ac4a27bb46ebf2ee696527"}, {"relpath": + "Resources/Favorites", "contentType": "FAVORITES", "defaultDisabled": false, + "id": "d63cdb1f23924a95a6dacd67ee5bb1cc"}, {"relpath": "Resources/CustomFunctions", + "contentType": "CUSTOM_FUNCTIONS", "defaultDisabled": false, "id": "663a607e904f452393e4a5c20b5739f1"}, + {"relpath": "Resources/Custom", "contentType": "GENERIC", "defaultDisabled": + false, "id": "37b26b0198294b909ea48b6f8d71858b"}, {"relpath": "ReferenceResults", + "contentType": "REFERENCE_RESULTS", "defaultDisabled": false, "id": "7f6b8a805fa7440b91ab8b7514bbeddb"}, + {"relpath": "Resources/ExperimentDefinitions", "contentType": "EXPERIMENT_DEFINITIONS", + "defaultDisabled": false, "id": "cdddf754dd5845b1a31fd6ed14cbcb02"}], "executionOptions": + []}, "projectType": "LOCAL", "storageLocation": "USERSPACE"}' + headers: + Connection: + - keep-alive + Content-Type: + - application/json + Transfer-Encoding: + - chunked + content-length: + - '1023' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + method: GET + uri: /user/test-user-uniqid/impact/api/workspaces/impact-python-client-workspace1 + response: + body: + string: '{"definition": {"name": "impact-python-client-workspace1", "description": + "", "defaultProjectId": "46e51f746c53db674d0d71cdcc7a085f81d7c3c9", "projects": + [{"reference": {"id": "46e51f746c53db674d0d71cdcc7a085f81d7c3c9"}, "disabled": + false, "disabledContent": []}, {"reference": {"id": "945dc27b4abb5ec2c802d47abb50ba8c993c287a"}, + "disabled": false, "disabledContent": []}], "dependencies": [{"reference": + {"id": "fec43f77925949bd7e7c0f10ac49ebc1189dc840", "name": "Modelica", "version": + "3.2.3"}, "disabled": true, "disabledContent": []}, {"reference": {"id": "ac04a5da97bc2e11bffb7f41b2485da347846df6", + "name": "Modelica", "version": "4.0.0"}, "disabled": true, "disabledContent": + []}, {"reference": {"id": "03a291276bb1f38120a5d4d2c4068a2d3d286274", "name": + "Modelica", "version": "4.1.0"}, "disabled": false, "disabledContent": []}], + "format": "1.0.0", "guid": "4bceceb852704a6382d916e36ea625b0", "createdBy": + "test-user-uniqid", "createdAt": 1779342357536}, "id": "impact-python-client-workspace1", + "conversion": {"state": "UP_TO_DATE"}}' + headers: + Connection: + - keep-alive + Content-Type: + - application/json + Transfer-Encoding: + - chunked + content-length: + - '1061' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + method: GET + uri: /user/test-user-uniqid/impact/api/workspaces/impact-python-client-workspace1/dependencies + response: + body: + string: '{"data": {"items": [{"id": "fec43f77925949bd7e7c0f10ac49ebc1189dc840", + "definition": {"name": "Modelica", "version": "3.2.3", "format": "1.0.0", + "dependencies": [], "content": [{"relpath": "Modelica", "contentType": "MODELICA", + "name": "Modelica", "defaultDisabled": false, "id": "925cbe6daaf3ebde61dfcc2a26f93e6d0798085a"}, + {"relpath": "ModelicaServices", "contentType": "MODELICA", "name": "ModelicaServices", + "defaultDisabled": false, "id": "d8c8e871abd21d4b942dae9cb0acf2f36b4a7fbf"}, + {"relpath": "Complex.mo", "contentType": "MODELICA", "name": "Complex", "defaultDisabled": + false, "id": "030aea7607c6536d47e6e78d4a11f12f8a5dab8b"}], "executionOptions": + [], "icon": "../MSL400/Modelica/Resources/Images/Logos/Modelica_Libraries.svg"}, + "projectType": "SYSTEM", "storageLocation": "SYSTEM"}, {"id": "ac04a5da97bc2e11bffb7f41b2485da347846df6", + "definition": {"name": "Modelica", "version": "4.0.0", "format": "1.0.0", + "dependencies": [], "content": [{"relpath": "Modelica", "contentType": "MODELICA", + "name": "Modelica", "defaultDisabled": false, "id": "925cbe6daaf3ebde61dfcc2a26f93e6d0798085a"}, + {"relpath": "ModelicaServices", "contentType": "MODELICA", "name": "ModelicaServices", + "defaultDisabled": false, "id": "d8c8e871abd21d4b942dae9cb0acf2f36b4a7fbf"}, + {"relpath": "Complex.mo", "contentType": "MODELICA", "name": "Complex", "defaultDisabled": + false, "id": "030aea7607c6536d47e6e78d4a11f12f8a5dab8b"}], "executionOptions": + [], "icon": "Modelica/Resources/Images/Logos/Modelica_Libraries.svg"}, "projectType": + "SYSTEM", "storageLocation": "SYSTEM"}, {"id": "03a291276bb1f38120a5d4d2c4068a2d3d286274", + "definition": {"name": "Modelica", "version": "4.1.0", "format": "1.0.0", + "dependencies": [], "content": [{"relpath": "Modelica", "contentType": "MODELICA", + "name": "Modelica", "defaultDisabled": false, "id": "925cbe6daaf3ebde61dfcc2a26f93e6d0798085a"}, + {"relpath": "ModelicaServices", "contentType": "MODELICA", "name": "ModelicaServices", + "defaultDisabled": false, "id": "d8c8e871abd21d4b942dae9cb0acf2f36b4a7fbf"}, + {"relpath": "Complex.mo", "contentType": "MODELICA", "name": "Complex", "defaultDisabled": + false, "id": "030aea7607c6536d47e6e78d4a11f12f8a5dab8b"}], "executionOptions": + [], "icon": "Modelica/Resources/Images/Logos/Modelica_Libraries.svg"}, "projectType": + "SYSTEM", "storageLocation": "SYSTEM"}]}}' + headers: + Connection: + - keep-alive + Content-Type: + - application/json + Transfer-Encoding: + - chunked + content-length: + - '2175' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + method: GET + uri: /user/test-user-uniqid/impact/api/workspaces/impact-python-client-workspace1/projects + response: + body: + string: '{"data": {"items": [{"id": "46e51f746c53db674d0d71cdcc7a085f81d7c3c9", + "definition": {"name": "Impact-python-client-workspace1", "format": "1.0.0", + "dependencies": [{"name": "Modelica", "versionSpecifier": "4.1.0"}], "content": + [{"relpath": "Resources/Views", "contentType": "VIEWS", "defaultDisabled": + false, "id": "2897ed70cdcd4493bb8be7e90884d0bf"}, {"relpath": "Resources/Favorites", + "contentType": "FAVORITES", "defaultDisabled": false, "id": "21fc515e2c5946eb8a91500a1bd53e2e"}, + {"relpath": "Resources/CustomFunctions", "contentType": "CUSTOM_FUNCTIONS", + "defaultDisabled": false, "id": "e1df4d85f104472ab171abf32ed8722d"}, {"relpath": + "Resources/Custom", "contentType": "GENERIC", "defaultDisabled": false, "id": + "ab7f1379c87d4d9784aebb524e8ae8e8"}, {"relpath": "ReferenceResults", "contentType": + "REFERENCE_RESULTS", "defaultDisabled": false, "id": "3647ba9fd3034680b54b19d706653cb9"}, + {"relpath": "Resources/ExperimentDefinitions", "contentType": "EXPERIMENT_DEFINITIONS", + "defaultDisabled": false, "id": "fe3dbbf051c444ec9e5f90d986dd05f1"}], "executionOptions": + []}, "projectType": "LOCAL", "storageLocation": "USERSPACE"}, {"id": "945dc27b4abb5ec2c802d47abb50ba8c993c287a", + "definition": {"name": "Project1", "format": "1.0.0", "dependencies": [{"name": + "Modelica", "versionSpecifier": "4.1.0"}], "content": [{"relpath": "Resources/Views", + "contentType": "VIEWS", "defaultDisabled": false, "id": "c78da39287ac4a27bb46ebf2ee696527"}, + {"relpath": "Resources/Favorites", "contentType": "FAVORITES", "defaultDisabled": + false, "id": "d63cdb1f23924a95a6dacd67ee5bb1cc"}, {"relpath": "Resources/CustomFunctions", + "contentType": "CUSTOM_FUNCTIONS", "defaultDisabled": false, "id": "663a607e904f452393e4a5c20b5739f1"}, + {"relpath": "Resources/Custom", "contentType": "GENERIC", "defaultDisabled": + false, "id": "37b26b0198294b909ea48b6f8d71858b"}, {"relpath": "ReferenceResults", + "contentType": "REFERENCE_RESULTS", "defaultDisabled": false, "id": "7f6b8a805fa7440b91ab8b7514bbeddb"}, + {"relpath": "Resources/ExperimentDefinitions", "contentType": "EXPERIMENT_DEFINITIONS", + "defaultDisabled": false, "id": "cdddf754dd5845b1a31fd6ed14cbcb02"}], "executionOptions": + []}, "projectType": "LOCAL", "storageLocation": "USERSPACE"}]}}' + headers: + Connection: + - keep-alive + Content-Type: + - application/json + Transfer-Encoding: + - chunked + content-length: + - '2091' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + method: GET + uri: /user/test-user-uniqid/impact/api/projects/945dc27b4abb5ec2c802d47abb50ba8c993c287a + response: + body: + string: '{"id": "945dc27b4abb5ec2c802d47abb50ba8c993c287a", "definition": {"name": + "Project1", "format": "1.0.0", "dependencies": [{"name": "Modelica", "versionSpecifier": + "4.1.0"}], "content": [{"relpath": "Resources/Views", "contentType": "VIEWS", + "defaultDisabled": false, "id": "c78da39287ac4a27bb46ebf2ee696527"}, {"relpath": + "Resources/Favorites", "contentType": "FAVORITES", "defaultDisabled": false, + "id": "d63cdb1f23924a95a6dacd67ee5bb1cc"}, {"relpath": "Resources/CustomFunctions", + "contentType": "CUSTOM_FUNCTIONS", "defaultDisabled": false, "id": "663a607e904f452393e4a5c20b5739f1"}, + {"relpath": "Resources/Custom", "contentType": "GENERIC", "defaultDisabled": + false, "id": "37b26b0198294b909ea48b6f8d71858b"}, {"relpath": "ReferenceResults", + "contentType": "REFERENCE_RESULTS", "defaultDisabled": false, "id": "7f6b8a805fa7440b91ab8b7514bbeddb"}, + {"relpath": "Resources/ExperimentDefinitions", "contentType": "EXPERIMENT_DEFINITIONS", + "defaultDisabled": false, "id": "cdddf754dd5845b1a31fd6ed14cbcb02"}], "executionOptions": + []}, "projectType": "LOCAL", "storageLocation": "USERSPACE"}' + headers: + Connection: + - keep-alive + Content-Type: + - application/json + Transfer-Encoding: + - chunked + content-length: + - '1023' + status: + code: 200 + message: OK +- request: + body: '{"definition": {"name": "impact-python-client-workspace1", "description": + "", "defaultProjectId": "46e51f746c53db674d0d71cdcc7a085f81d7c3c9", "projects": + [{"reference": {"id": "46e51f746c53db674d0d71cdcc7a085f81d7c3c9"}, "disabled": + false, "disabledContent": []}, {"reference": {"id": "945dc27b4abb5ec2c802d47abb50ba8c993c287a"}, + "disabled": true, "disabledContent": []}], "dependencies": [{"reference": {"id": + "fec43f77925949bd7e7c0f10ac49ebc1189dc840", "name": "Modelica", "version": "3.2.3"}, + "disabled": true, "disabledContent": []}, {"reference": {"id": "ac04a5da97bc2e11bffb7f41b2485da347846df6", + "name": "Modelica", "version": "4.0.0"}, "disabled": true, "disabledContent": + []}, {"reference": {"id": "03a291276bb1f38120a5d4d2c4068a2d3d286274", "name": + "Modelica", "version": "4.1.0"}, "disabled": false, "disabledContent": []}, + {"reference": {"id": "945dc27b4abb5ec2c802d47abb50ba8c993c287a"}}], "format": + "1.0.0", "guid": "4bceceb852704a6382d916e36ea625b0", "createdBy": "9db11c0c-5a40-4ca0-93b0-84a5b49e0927", + "createdAt": 1779342357536}, "id": "impact-python-client-workspace1", "conversion": + {"state": "UP_TO_DATE"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '1127' + Content-Type: + - application/json + method: PUT + uri: /user/test-user-uniqid/impact/api/workspaces/impact-python-client-workspace1 + response: + body: + string: '{"definition": {"name": "impact-python-client-workspace1", "description": + "", "defaultProjectId": "46e51f746c53db674d0d71cdcc7a085f81d7c3c9", "projects": + [{"reference": {"id": "46e51f746c53db674d0d71cdcc7a085f81d7c3c9"}, "disabled": + false, "disabledContent": []}, {"reference": {"id": "945dc27b4abb5ec2c802d47abb50ba8c993c287a"}, + "disabled": true, "disabledContent": []}], "dependencies": [{"reference": + {"id": "fec43f77925949bd7e7c0f10ac49ebc1189dc840", "name": "Modelica", "version": + "3.2.3"}, "disabled": true, "disabledContent": []}, {"reference": {"id": "ac04a5da97bc2e11bffb7f41b2485da347846df6", + "name": "Modelica", "version": "4.0.0"}, "disabled": true, "disabledContent": + []}, {"reference": {"id": "03a291276bb1f38120a5d4d2c4068a2d3d286274", "name": + "Modelica", "version": "4.1.0"}, "disabled": false, "disabledContent": []}, + {"reference": {"id": "945dc27b4abb5ec2c802d47abb50ba8c993c287a"}, "disabled": + false, "disabledContent": []}], "format": "1.0.0", "guid": "4bceceb852704a6382d916e36ea625b0", + "createdBy": "test-user-uniqid", "createdAt": 1779342357536}, "id": "impact-python-client-workspace1", + "conversion": {"state": "UP_TO_DATE"}}' + headers: + Connection: + - keep-alive + Content-Type: + - application/json + Transfer-Encoding: + - chunked + content-length: + - '1169' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + method: GET + uri: /user/test-user-uniqid/impact/api/workspaces/impact-python-client-workspace1 + response: + body: + string: '{"definition": {"name": "impact-python-client-workspace1", "description": + "", "defaultProjectId": "46e51f746c53db674d0d71cdcc7a085f81d7c3c9", "projects": + [{"reference": {"id": "46e51f746c53db674d0d71cdcc7a085f81d7c3c9"}, "disabled": + false, "disabledContent": []}, {"reference": {"id": "945dc27b4abb5ec2c802d47abb50ba8c993c287a"}, + "disabled": true, "disabledContent": []}], "dependencies": [{"reference": + {"id": "fec43f77925949bd7e7c0f10ac49ebc1189dc840", "name": "Modelica", "version": + "3.2.3"}, "disabled": true, "disabledContent": []}, {"reference": {"id": "ac04a5da97bc2e11bffb7f41b2485da347846df6", + "name": "Modelica", "version": "4.0.0"}, "disabled": true, "disabledContent": + []}, {"reference": {"id": "03a291276bb1f38120a5d4d2c4068a2d3d286274", "name": + "Modelica", "version": "4.1.0"}, "disabled": false, "disabledContent": []}, + {"reference": {"id": "945dc27b4abb5ec2c802d47abb50ba8c993c287a"}, "disabled": + false, "disabledContent": []}], "format": "1.0.0", "guid": "4bceceb852704a6382d916e36ea625b0", + "createdBy": "test-user-uniqid", "createdAt": 1779342357536}, "id": "impact-python-client-workspace1", + "conversion": {"state": "UP_TO_DATE"}}' + headers: + Connection: + - keep-alive + Content-Type: + - application/json + Transfer-Encoding: + - chunked + content-length: + - '1169' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + method: GET + uri: /user/test-user-uniqid/impact/api/workspaces + response: + body: + string: '{"data": {"items": [{"definition": {"name": "test", "description": + "", "defaultProjectId": "fe964271cbc1f5c5739e3b4e485ed329fd862a77", "projects": + [{"reference": {"id": "fe964271cbc1f5c5739e3b4e485ed329fd862a77"}, "disabled": + false, "disabledContent": []}], "dependencies": [{"reference": {"id": "fec43f77925949bd7e7c0f10ac49ebc1189dc840", + "name": "Modelica", "version": "3.2.3"}, "disabled": true, "disabledContent": + []}, {"reference": {"id": "ac04a5da97bc2e11bffb7f41b2485da347846df6", "name": + "Modelica", "version": "4.0.0"}, "disabled": true, "disabledContent": []}, + {"reference": {"id": "03a291276bb1f38120a5d4d2c4068a2d3d286274", "name": "Modelica", + "version": "4.1.0"}, "disabled": false, "disabledContent": []}], "format": + "1.0.0", "guid": "a81ae267561f455c98bc6710c23176f9", "createdBy": "test-user-uniqid", + "createdAt": 1779271558352}, "id": "test", "conversion": {"state": "UP_TO_DATE"}}, + {"definition": {"name": "impact-python-client-workspace1", "description": + "", "defaultProjectId": "46e51f746c53db674d0d71cdcc7a085f81d7c3c9", "projects": + [{"reference": {"id": "46e51f746c53db674d0d71cdcc7a085f81d7c3c9"}, "disabled": + false, "disabledContent": []}, {"reference": {"id": "945dc27b4abb5ec2c802d47abb50ba8c993c287a"}, + "disabled": true, "disabledContent": []}], "dependencies": [{"reference": + {"id": "fec43f77925949bd7e7c0f10ac49ebc1189dc840", "name": "Modelica", "version": + "3.2.3"}, "disabled": true, "disabledContent": []}, {"reference": {"id": "ac04a5da97bc2e11bffb7f41b2485da347846df6", + "name": "Modelica", "version": "4.0.0"}, "disabled": true, "disabledContent": + []}, {"reference": {"id": "03a291276bb1f38120a5d4d2c4068a2d3d286274", "name": + "Modelica", "version": "4.1.0"}, "disabled": false, "disabledContent": []}, + {"reference": {"id": "945dc27b4abb5ec2c802d47abb50ba8c993c287a"}, "disabled": + false, "disabledContent": []}], "format": "1.0.0", "guid": "4bceceb852704a6382d916e36ea625b0", + "createdBy": "test-user-uniqid", "createdAt": 1779342357536}, "id": "impact-python-client-workspace1", + "conversion": {"state": "UP_TO_DATE"}}]}}' + headers: + Connection: + - keep-alive + Content-Type: + - application/json + Transfer-Encoding: + - chunked + content-length: + - '2092' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + method: GET + uri: /user/test-user-uniqid/impact/api/workspaces/test + response: + body: + string: '{"definition": {"name": "test", "description": "", "defaultProjectId": + "fe964271cbc1f5c5739e3b4e485ed329fd862a77", "projects": [{"reference": {"id": + "fe964271cbc1f5c5739e3b4e485ed329fd862a77"}, "disabled": false, "disabledContent": + []}], "dependencies": [{"reference": {"id": "fec43f77925949bd7e7c0f10ac49ebc1189dc840", + "name": "Modelica", "version": "3.2.3"}, "disabled": true, "disabledContent": + []}, {"reference": {"id": "ac04a5da97bc2e11bffb7f41b2485da347846df6", "name": + "Modelica", "version": "4.0.0"}, "disabled": true, "disabledContent": []}, + {"reference": {"id": "03a291276bb1f38120a5d4d2c4068a2d3d286274", "name": "Modelica", + "version": "4.1.0"}, "disabled": false, "disabledContent": []}], "format": + "1.0.0", "guid": "a81ae267561f455c98bc6710c23176f9", "createdBy": "test-user-uniqid", + "createdAt": 1779271558352}, "id": "test", "conversion": {"state": "UP_TO_DATE"}}' + headers: + Connection: + - keep-alive + Content-Type: + - application/json + Transfer-Encoding: + - chunked + content-length: + - '898' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + method: GET + uri: /user/test-user-uniqid/impact/api/workspaces/test + response: + body: + string: '{"definition": {"name": "test", "description": "", "defaultProjectId": + "fe964271cbc1f5c5739e3b4e485ed329fd862a77", "projects": [{"reference": {"id": + "fe964271cbc1f5c5739e3b4e485ed329fd862a77"}, "disabled": false, "disabledContent": + []}], "dependencies": [{"reference": {"id": "fec43f77925949bd7e7c0f10ac49ebc1189dc840", + "name": "Modelica", "version": "3.2.3"}, "disabled": true, "disabledContent": + []}, {"reference": {"id": "ac04a5da97bc2e11bffb7f41b2485da347846df6", "name": + "Modelica", "version": "4.0.0"}, "disabled": true, "disabledContent": []}, + {"reference": {"id": "03a291276bb1f38120a5d4d2c4068a2d3d286274", "name": "Modelica", + "version": "4.1.0"}, "disabled": false, "disabledContent": []}], "format": + "1.0.0", "guid": "a81ae267561f455c98bc6710c23176f9", "createdBy": "test-user-uniqid", + "createdAt": 1779271558352}, "id": "test", "conversion": {"state": "UP_TO_DATE"}}' + headers: + Connection: + - keep-alive + Content-Type: + - application/json + Transfer-Encoding: + - chunked + content-length: + - '898' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + method: GET + uri: /user/test-user-uniqid/impact/api/workspaces/impact-python-client-workspace1 + response: + body: + string: '{"definition": {"name": "impact-python-client-workspace1", "description": + "", "defaultProjectId": "46e51f746c53db674d0d71cdcc7a085f81d7c3c9", "projects": + [{"reference": {"id": "46e51f746c53db674d0d71cdcc7a085f81d7c3c9"}, "disabled": + false, "disabledContent": []}, {"reference": {"id": "945dc27b4abb5ec2c802d47abb50ba8c993c287a"}, + "disabled": true, "disabledContent": []}], "dependencies": [{"reference": + {"id": "fec43f77925949bd7e7c0f10ac49ebc1189dc840", "name": "Modelica", "version": + "3.2.3"}, "disabled": true, "disabledContent": []}, {"reference": {"id": "ac04a5da97bc2e11bffb7f41b2485da347846df6", + "name": "Modelica", "version": "4.0.0"}, "disabled": true, "disabledContent": + []}, {"reference": {"id": "03a291276bb1f38120a5d4d2c4068a2d3d286274", "name": + "Modelica", "version": "4.1.0"}, "disabled": false, "disabledContent": []}, + {"reference": {"id": "945dc27b4abb5ec2c802d47abb50ba8c993c287a"}, "disabled": + false, "disabledContent": []}], "format": "1.0.0", "guid": "4bceceb852704a6382d916e36ea625b0", + "createdBy": "test-user-uniqid", "createdAt": 1779342357536}, "id": "impact-python-client-workspace1", + "conversion": {"state": "UP_TO_DATE"}}' + headers: + Connection: + - keep-alive + Content-Type: + - application/json + Transfer-Encoding: + - chunked + content-length: + - '1169' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + method: GET + uri: /user/test-user-uniqid/impact/api/workspaces/impact-python-client-workspace1/projects + response: + body: + string: '{"data": {"items": [{"id": "46e51f746c53db674d0d71cdcc7a085f81d7c3c9", + "definition": {"name": "Impact-python-client-workspace1", "format": "1.0.0", + "dependencies": [{"name": "Modelica", "versionSpecifier": "4.1.0"}], "content": + [{"relpath": "Resources/Views", "contentType": "VIEWS", "defaultDisabled": + false, "id": "2897ed70cdcd4493bb8be7e90884d0bf"}, {"relpath": "Resources/Favorites", + "contentType": "FAVORITES", "defaultDisabled": false, "id": "21fc515e2c5946eb8a91500a1bd53e2e"}, + {"relpath": "Resources/CustomFunctions", "contentType": "CUSTOM_FUNCTIONS", + "defaultDisabled": false, "id": "e1df4d85f104472ab171abf32ed8722d"}, {"relpath": + "Resources/Custom", "contentType": "GENERIC", "defaultDisabled": false, "id": + "ab7f1379c87d4d9784aebb524e8ae8e8"}, {"relpath": "ReferenceResults", "contentType": + "REFERENCE_RESULTS", "defaultDisabled": false, "id": "3647ba9fd3034680b54b19d706653cb9"}, + {"relpath": "Resources/ExperimentDefinitions", "contentType": "EXPERIMENT_DEFINITIONS", + "defaultDisabled": false, "id": "fe3dbbf051c444ec9e5f90d986dd05f1"}], "executionOptions": + []}, "projectType": "LOCAL", "storageLocation": "USERSPACE"}]}}' + headers: + Connection: + - keep-alive + Content-Type: + - application/json + Transfer-Encoding: + - chunked + content-length: + - '1067' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + method: DELETE + uri: /user/test-user-uniqid/impact/api/projects/46e51f746c53db674d0d71cdcc7a085f81d7c3c9 + response: + body: + string: '{"id": "46e51f746c53db674d0d71cdcc7a085f81d7c3c9", "definition": {"name": + "Impact-python-client-workspace1", "format": "1.0.0", "dependencies": [{"name": + "Modelica", "versionSpecifier": "4.1.0"}], "content": [{"relpath": "Resources/Views", + "contentType": "VIEWS", "defaultDisabled": false, "id": "2897ed70cdcd4493bb8be7e90884d0bf"}, + {"relpath": "Resources/Favorites", "contentType": "FAVORITES", "defaultDisabled": + false, "id": "21fc515e2c5946eb8a91500a1bd53e2e"}, {"relpath": "Resources/CustomFunctions", + "contentType": "CUSTOM_FUNCTIONS", "defaultDisabled": false, "id": "e1df4d85f104472ab171abf32ed8722d"}, + {"relpath": "Resources/Custom", "contentType": "GENERIC", "defaultDisabled": + false, "id": "ab7f1379c87d4d9784aebb524e8ae8e8"}, {"relpath": "ReferenceResults", + "contentType": "REFERENCE_RESULTS", "defaultDisabled": false, "id": "3647ba9fd3034680b54b19d706653cb9"}, + {"relpath": "Resources/ExperimentDefinitions", "contentType": "EXPERIMENT_DEFINITIONS", + "defaultDisabled": false, "id": "fe3dbbf051c444ec9e5f90d986dd05f1"}], "executionOptions": + []}, "projectType": "LOCAL", "storageLocation": "USERSPACE"}' + headers: + Connection: + - keep-alive + Content-Type: + - application/json + Transfer-Encoding: + - chunked + content-length: + - '1046' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + method: DELETE + uri: /user/test-user-uniqid/impact/api/workspaces/impact-python-client-workspace1 + response: + body: + string: '' + headers: + Connection: + - keep-alive + Content-Type: + - application/json + status: + code: 200 + message: OK +version: 1 diff --git a/tests/fixtures/vcr_cassettes/test_workspace/TestWorkspace.test_add_dependencies_disables_existing_entry_with_same_name.yaml b/tests/fixtures/vcr_cassettes/test_workspace/TestWorkspace.test_add_dependencies_disables_existing_entry_with_same_name.yaml new file mode 100644 index 00000000..3cb0e03e --- /dev/null +++ b/tests/fixtures/vcr_cassettes/test_workspace/TestWorkspace.test_add_dependencies_disables_existing_entry_with_same_name.yaml @@ -0,0 +1,892 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + method: GET + uri: /hub/api/ + response: + body: + string: '{"version": "5.3.0"}' + headers: + Connection: + - keep-alive + Content-Type: + - application/json + access-control-allow-headers: + - accept, content-type, authorization + access-control-allow-origin: + - '*' + x-jupyterhub-version: + - 5.3.0 + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + method: GET + uri: /hub/api/ + response: + body: + string: '{"version": "5.3.0"}' + headers: + Connection: + - keep-alive + Content-Type: + - application/json + access-control-allow-headers: + - accept, content-type, authorization + access-control-allow-origin: + - '*' + x-jupyterhub-version: + - 5.3.0 + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + method: GET + uri: /hub/api/user + response: + body: + string: '{"name": "test-user-uniqid", "server": "/user/test-user-uniqid/"}' + headers: + Connection: + - keep-alive + Content-Type: + - application/json + access-control-allow-headers: + - accept, content-type, authorization + x-jupyterhub-version: + - 5.3.0 + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + method: GET + uri: /user/test-user-uniqid/impact/api/users/me + response: + body: + string: '{"data": {"id": "test-user-uniqid", "username": "test-user", "firstName": + null, "lastName": null, "email": "test-user@modelon.com", "license": "impact-pro", + "roles": ["impact-editor", "offline_access", "impact-viewer", "uma_authorization", + "default-roles-modelon", "impact-pro", "impact-executor", "impact-workspace-publisher"], + "tenant": {"id": "org1", "groupName": "impact-tenant-org1"}}}' + headers: + Connection: + - keep-alive + Content-Type: + - application/json + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + method: GET + uri: /user/test-user-uniqid/impact/api/ + response: + body: + string: '{"version": "4.28.0"}' + headers: + Connection: + - keep-alive + Content-Type: + - application/json + Transfer-Encoding: + - chunked + content-length: + - '21' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + method: GET + uri: /user/test-user-uniqid/impact/api/users/me + response: + body: + string: '{"data": {"id": "test-user-uniqid", "username": "test-user", "firstName": + null, "lastName": null, "email": "test-user@modelon.com", "license": "impact-pro", + "roles": ["impact-editor", "offline_access", "impact-viewer", "uma_authorization", + "default-roles-modelon", "impact-pro", "impact-executor", "impact-workspace-publisher"], + "tenant": {"id": "org1", "groupName": "impact-tenant-org1"}}}' + headers: + Connection: + - keep-alive + Content-Type: + - application/json + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + method: GET + uri: /user/test-user-uniqid/impact/api/workspaces + response: + body: + string: '{"data": {"items": [{"definition": {"name": "test", "description": + "", "defaultProjectId": "fe964271cbc1f5c5739e3b4e485ed329fd862a77", "projects": + [{"reference": {"id": "fe964271cbc1f5c5739e3b4e485ed329fd862a77"}, "disabled": + false, "disabledContent": []}], "dependencies": [{"reference": {"id": "fec43f77925949bd7e7c0f10ac49ebc1189dc840", + "name": "Modelica", "version": "3.2.3"}, "disabled": true, "disabledContent": + []}, {"reference": {"id": "ac04a5da97bc2e11bffb7f41b2485da347846df6", "name": + "Modelica", "version": "4.0.0"}, "disabled": true, "disabledContent": []}, + {"reference": {"id": "03a291276bb1f38120a5d4d2c4068a2d3d286274", "name": "Modelica", + "version": "4.1.0"}, "disabled": false, "disabledContent": []}], "format": + "1.0.0", "guid": "a81ae267561f455c98bc6710c23176f9", "createdBy": "test-user-uniqid", + "createdAt": 1779271558352}, "id": "test", "conversion": {"state": "UP_TO_DATE"}}]}}' + headers: + Connection: + - keep-alive + Content-Type: + - application/json + Transfer-Encoding: + - chunked + content-length: + - '921' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + method: GET + uri: /user/test-user-uniqid/impact/api/workspaces/test + response: + body: + string: '{"definition": {"name": "test", "description": "", "defaultProjectId": + "fe964271cbc1f5c5739e3b4e485ed329fd862a77", "projects": [{"reference": {"id": + "fe964271cbc1f5c5739e3b4e485ed329fd862a77"}, "disabled": false, "disabledContent": + []}], "dependencies": [{"reference": {"id": "fec43f77925949bd7e7c0f10ac49ebc1189dc840", + "name": "Modelica", "version": "3.2.3"}, "disabled": true, "disabledContent": + []}, {"reference": {"id": "ac04a5da97bc2e11bffb7f41b2485da347846df6", "name": + "Modelica", "version": "4.0.0"}, "disabled": true, "disabledContent": []}, + {"reference": {"id": "03a291276bb1f38120a5d4d2c4068a2d3d286274", "name": "Modelica", + "version": "4.1.0"}, "disabled": false, "disabledContent": []}], "format": + "1.0.0", "guid": "a81ae267561f455c98bc6710c23176f9", "createdBy": "test-user-uniqid", + "createdAt": 1779271558352}, "id": "test", "conversion": {"state": "UP_TO_DATE"}}' + headers: + Connection: + - keep-alive + Content-Type: + - application/json + Transfer-Encoding: + - chunked + content-length: + - '898' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + method: GET + uri: /user/test-user-uniqid/impact/api/workspaces/test + response: + body: + string: '{"definition": {"name": "test", "description": "", "defaultProjectId": + "fe964271cbc1f5c5739e3b4e485ed329fd862a77", "projects": [{"reference": {"id": + "fe964271cbc1f5c5739e3b4e485ed329fd862a77"}, "disabled": false, "disabledContent": + []}], "dependencies": [{"reference": {"id": "fec43f77925949bd7e7c0f10ac49ebc1189dc840", + "name": "Modelica", "version": "3.2.3"}, "disabled": true, "disabledContent": + []}, {"reference": {"id": "ac04a5da97bc2e11bffb7f41b2485da347846df6", "name": + "Modelica", "version": "4.0.0"}, "disabled": true, "disabledContent": []}, + {"reference": {"id": "03a291276bb1f38120a5d4d2c4068a2d3d286274", "name": "Modelica", + "version": "4.1.0"}, "disabled": false, "disabledContent": []}], "format": + "1.0.0", "guid": "a81ae267561f455c98bc6710c23176f9", "createdBy": "test-user-uniqid", + "createdAt": 1779271558352}, "id": "test", "conversion": {"state": "UP_TO_DATE"}}' + headers: + Connection: + - keep-alive + Content-Type: + - application/json + Transfer-Encoding: + - chunked + content-length: + - '898' + status: + code: 200 + message: OK +- request: + body: '{"new": {"name": "impact-python-client-workspace1"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '52' + Content-Type: + - application/json + method: POST + uri: /user/test-user-uniqid/impact/api/workspaces + response: + body: + string: '{"definition": {"name": "impact-python-client-workspace1", "description": + "", "defaultProjectId": "46e51f746c53db674d0d71cdcc7a085f81d7c3c9", "projects": + [{"reference": {"id": "46e51f746c53db674d0d71cdcc7a085f81d7c3c9"}, "disabled": + false, "disabledContent": []}], "dependencies": [{"reference": {"id": "fec43f77925949bd7e7c0f10ac49ebc1189dc840", + "name": "Modelica", "version": "3.2.3"}, "disabled": true, "disabledContent": + []}, {"reference": {"id": "ac04a5da97bc2e11bffb7f41b2485da347846df6", "name": + "Modelica", "version": "4.0.0"}, "disabled": true, "disabledContent": []}, + {"reference": {"id": "03a291276bb1f38120a5d4d2c4068a2d3d286274", "name": "Modelica", + "version": "4.1.0"}, "disabled": false, "disabledContent": []}], "format": + "1.0.0", "guid": "492577d45b924739a04cda98324d64d1", "createdBy": "test-user-uniqid", + "createdAt": 1779342381510}, "id": "impact-python-client-workspace1", "conversion": + {"state": "UP_TO_DATE"}}' + headers: + Connection: + - keep-alive + Content-Type: + - application/json + Transfer-Encoding: + - chunked + content-length: + - '952' + status: + code: 200 + message: OK +- request: + body: '{"new": {"name": "Project1"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '29' + Content-Type: + - application/json + method: POST + uri: /user/test-user-uniqid/impact/api/workspaces/impact-python-client-workspace1/projects + response: + body: + string: '{"id": "bb38b2a12a74e428af4f35a1021d2183cfa5773d", "definition": {"name": + "Project1", "format": "1.0.0", "dependencies": [{"name": "Modelica", "versionSpecifier": + "4.1.0"}], "content": [{"relpath": "Resources/Views", "contentType": "VIEWS", + "defaultDisabled": false, "id": "d841992ba47247cf9469ff411fafe686"}, {"relpath": + "Resources/Favorites", "contentType": "FAVORITES", "defaultDisabled": false, + "id": "b7e33093e0204280a377ea16a36eed86"}, {"relpath": "Resources/CustomFunctions", + "contentType": "CUSTOM_FUNCTIONS", "defaultDisabled": false, "id": "73d2086bfdff4c63b1547c222a949c8a"}, + {"relpath": "Resources/Custom", "contentType": "GENERIC", "defaultDisabled": + false, "id": "ed94cc247dd046c09c78a7f28f070dbe"}, {"relpath": "ReferenceResults", + "contentType": "REFERENCE_RESULTS", "defaultDisabled": false, "id": "345f8ab4233844a0a6040281c24e8f70"}, + {"relpath": "Resources/ExperimentDefinitions", "contentType": "EXPERIMENT_DEFINITIONS", + "defaultDisabled": false, "id": "7c58dd8983e342db9f1b1da612a5016a"}], "executionOptions": + []}, "projectType": "LOCAL", "storageLocation": "USERSPACE"}' + headers: + Connection: + - keep-alive + Content-Type: + - application/json + Transfer-Encoding: + - chunked + content-length: + - '1023' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + method: GET + uri: /user/test-user-uniqid/impact/api/workspaces/impact-python-client-workspace1 + response: + body: + string: '{"definition": {"name": "impact-python-client-workspace1", "description": + "", "defaultProjectId": "46e51f746c53db674d0d71cdcc7a085f81d7c3c9", "projects": + [{"reference": {"id": "46e51f746c53db674d0d71cdcc7a085f81d7c3c9"}, "disabled": + false, "disabledContent": []}, {"reference": {"id": "bb38b2a12a74e428af4f35a1021d2183cfa5773d"}, + "disabled": false, "disabledContent": []}], "dependencies": [{"reference": + {"id": "fec43f77925949bd7e7c0f10ac49ebc1189dc840", "name": "Modelica", "version": + "3.2.3"}, "disabled": true, "disabledContent": []}, {"reference": {"id": "ac04a5da97bc2e11bffb7f41b2485da347846df6", + "name": "Modelica", "version": "4.0.0"}, "disabled": true, "disabledContent": + []}, {"reference": {"id": "03a291276bb1f38120a5d4d2c4068a2d3d286274", "name": + "Modelica", "version": "4.1.0"}, "disabled": false, "disabledContent": []}], + "format": "1.0.0", "guid": "492577d45b924739a04cda98324d64d1", "createdBy": + "test-user-uniqid", "createdAt": 1779342381510}, "id": "impact-python-client-workspace1", + "conversion": {"state": "UP_TO_DATE"}}' + headers: + Connection: + - keep-alive + Content-Type: + - application/json + Transfer-Encoding: + - chunked + content-length: + - '1061' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + method: GET + uri: /user/test-user-uniqid/impact/api/workspaces/impact-python-client-workspace1/dependencies + response: + body: + string: '{"data": {"items": [{"id": "fec43f77925949bd7e7c0f10ac49ebc1189dc840", + "definition": {"name": "Modelica", "version": "3.2.3", "format": "1.0.0", + "dependencies": [], "content": [{"relpath": "Modelica", "contentType": "MODELICA", + "name": "Modelica", "defaultDisabled": false, "id": "925cbe6daaf3ebde61dfcc2a26f93e6d0798085a"}, + {"relpath": "ModelicaServices", "contentType": "MODELICA", "name": "ModelicaServices", + "defaultDisabled": false, "id": "d8c8e871abd21d4b942dae9cb0acf2f36b4a7fbf"}, + {"relpath": "Complex.mo", "contentType": "MODELICA", "name": "Complex", "defaultDisabled": + false, "id": "030aea7607c6536d47e6e78d4a11f12f8a5dab8b"}], "executionOptions": + [], "icon": "../MSL400/Modelica/Resources/Images/Logos/Modelica_Libraries.svg"}, + "projectType": "SYSTEM", "storageLocation": "SYSTEM"}, {"id": "ac04a5da97bc2e11bffb7f41b2485da347846df6", + "definition": {"name": "Modelica", "version": "4.0.0", "format": "1.0.0", + "dependencies": [], "content": [{"relpath": "Modelica", "contentType": "MODELICA", + "name": "Modelica", "defaultDisabled": false, "id": "925cbe6daaf3ebde61dfcc2a26f93e6d0798085a"}, + {"relpath": "ModelicaServices", "contentType": "MODELICA", "name": "ModelicaServices", + "defaultDisabled": false, "id": "d8c8e871abd21d4b942dae9cb0acf2f36b4a7fbf"}, + {"relpath": "Complex.mo", "contentType": "MODELICA", "name": "Complex", "defaultDisabled": + false, "id": "030aea7607c6536d47e6e78d4a11f12f8a5dab8b"}], "executionOptions": + [], "icon": "Modelica/Resources/Images/Logos/Modelica_Libraries.svg"}, "projectType": + "SYSTEM", "storageLocation": "SYSTEM"}, {"id": "03a291276bb1f38120a5d4d2c4068a2d3d286274", + "definition": {"name": "Modelica", "version": "4.1.0", "format": "1.0.0", + "dependencies": [], "content": [{"relpath": "Modelica", "contentType": "MODELICA", + "name": "Modelica", "defaultDisabled": false, "id": "925cbe6daaf3ebde61dfcc2a26f93e6d0798085a"}, + {"relpath": "ModelicaServices", "contentType": "MODELICA", "name": "ModelicaServices", + "defaultDisabled": false, "id": "d8c8e871abd21d4b942dae9cb0acf2f36b4a7fbf"}, + {"relpath": "Complex.mo", "contentType": "MODELICA", "name": "Complex", "defaultDisabled": + false, "id": "030aea7607c6536d47e6e78d4a11f12f8a5dab8b"}], "executionOptions": + [], "icon": "Modelica/Resources/Images/Logos/Modelica_Libraries.svg"}, "projectType": + "SYSTEM", "storageLocation": "SYSTEM"}]}}' + headers: + Connection: + - keep-alive + Content-Type: + - application/json + Transfer-Encoding: + - chunked + content-length: + - '2175' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + method: GET + uri: /user/test-user-uniqid/impact/api/workspaces/impact-python-client-workspace1/projects + response: + body: + string: '{"data": {"items": [{"id": "46e51f746c53db674d0d71cdcc7a085f81d7c3c9", + "definition": {"name": "Impact-python-client-workspace1", "format": "1.0.0", + "dependencies": [{"name": "Modelica", "versionSpecifier": "4.1.0"}], "content": + [{"relpath": "Resources/Views", "contentType": "VIEWS", "defaultDisabled": + false, "id": "fcafa26f9a464f38969f72b73d875bb9"}, {"relpath": "Resources/Favorites", + "contentType": "FAVORITES", "defaultDisabled": false, "id": "5f3f0f7823484be6b3bd0d8300580d34"}, + {"relpath": "Resources/CustomFunctions", "contentType": "CUSTOM_FUNCTIONS", + "defaultDisabled": false, "id": "8af2bd44145c4babb713e1978d4d8df4"}, {"relpath": + "Resources/Custom", "contentType": "GENERIC", "defaultDisabled": false, "id": + "5e77621e4ee84b25aa5db0dc65da93a1"}, {"relpath": "ReferenceResults", "contentType": + "REFERENCE_RESULTS", "defaultDisabled": false, "id": "c8ef94924b124178bb86dfca9f3b205f"}, + {"relpath": "Resources/ExperimentDefinitions", "contentType": "EXPERIMENT_DEFINITIONS", + "defaultDisabled": false, "id": "f84068767a7e4e448cace8a5399c3fb7"}], "executionOptions": + []}, "projectType": "LOCAL", "storageLocation": "USERSPACE"}, {"id": "bb38b2a12a74e428af4f35a1021d2183cfa5773d", + "definition": {"name": "Project1", "format": "1.0.0", "dependencies": [{"name": + "Modelica", "versionSpecifier": "4.1.0"}], "content": [{"relpath": "Resources/Views", + "contentType": "VIEWS", "defaultDisabled": false, "id": "d841992ba47247cf9469ff411fafe686"}, + {"relpath": "Resources/Favorites", "contentType": "FAVORITES", "defaultDisabled": + false, "id": "b7e33093e0204280a377ea16a36eed86"}, {"relpath": "Resources/CustomFunctions", + "contentType": "CUSTOM_FUNCTIONS", "defaultDisabled": false, "id": "73d2086bfdff4c63b1547c222a949c8a"}, + {"relpath": "Resources/Custom", "contentType": "GENERIC", "defaultDisabled": + false, "id": "ed94cc247dd046c09c78a7f28f070dbe"}, {"relpath": "ReferenceResults", + "contentType": "REFERENCE_RESULTS", "defaultDisabled": false, "id": "345f8ab4233844a0a6040281c24e8f70"}, + {"relpath": "Resources/ExperimentDefinitions", "contentType": "EXPERIMENT_DEFINITIONS", + "defaultDisabled": false, "id": "7c58dd8983e342db9f1b1da612a5016a"}], "executionOptions": + []}, "projectType": "LOCAL", "storageLocation": "USERSPACE"}]}}' + headers: + Connection: + - keep-alive + Content-Type: + - application/json + Transfer-Encoding: + - chunked + content-length: + - '2091' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + method: GET + uri: /user/test-user-uniqid/impact/api/projects/bb38b2a12a74e428af4f35a1021d2183cfa5773d + response: + body: + string: '{"id": "bb38b2a12a74e428af4f35a1021d2183cfa5773d", "definition": {"name": + "Project1", "format": "1.0.0", "dependencies": [{"name": "Modelica", "versionSpecifier": + "4.1.0"}], "content": [{"relpath": "Resources/Views", "contentType": "VIEWS", + "defaultDisabled": false, "id": "d841992ba47247cf9469ff411fafe686"}, {"relpath": + "Resources/Favorites", "contentType": "FAVORITES", "defaultDisabled": false, + "id": "b7e33093e0204280a377ea16a36eed86"}, {"relpath": "Resources/CustomFunctions", + "contentType": "CUSTOM_FUNCTIONS", "defaultDisabled": false, "id": "73d2086bfdff4c63b1547c222a949c8a"}, + {"relpath": "Resources/Custom", "contentType": "GENERIC", "defaultDisabled": + false, "id": "ed94cc247dd046c09c78a7f28f070dbe"}, {"relpath": "ReferenceResults", + "contentType": "REFERENCE_RESULTS", "defaultDisabled": false, "id": "345f8ab4233844a0a6040281c24e8f70"}, + {"relpath": "Resources/ExperimentDefinitions", "contentType": "EXPERIMENT_DEFINITIONS", + "defaultDisabled": false, "id": "7c58dd8983e342db9f1b1da612a5016a"}], "executionOptions": + []}, "projectType": "LOCAL", "storageLocation": "USERSPACE"}' + headers: + Connection: + - keep-alive + Content-Type: + - application/json + Transfer-Encoding: + - chunked + content-length: + - '1023' + status: + code: 200 + message: OK +- request: + body: '{"definition": {"name": "impact-python-client-workspace1", "description": + "", "defaultProjectId": "46e51f746c53db674d0d71cdcc7a085f81d7c3c9", "projects": + [{"reference": {"id": "46e51f746c53db674d0d71cdcc7a085f81d7c3c9"}, "disabled": + false, "disabledContent": []}, {"reference": {"id": "bb38b2a12a74e428af4f35a1021d2183cfa5773d"}, + "disabled": true, "disabledContent": []}], "dependencies": [{"reference": {"id": + "fec43f77925949bd7e7c0f10ac49ebc1189dc840", "name": "Modelica", "version": "3.2.3"}, + "disabled": true, "disabledContent": []}, {"reference": {"id": "ac04a5da97bc2e11bffb7f41b2485da347846df6", + "name": "Modelica", "version": "4.0.0"}, "disabled": true, "disabledContent": + []}, {"reference": {"id": "03a291276bb1f38120a5d4d2c4068a2d3d286274", "name": + "Modelica", "version": "4.1.0"}, "disabled": false, "disabledContent": []}, + {"reference": {"id": "bb38b2a12a74e428af4f35a1021d2183cfa5773d"}}], "format": + "1.0.0", "guid": "492577d45b924739a04cda98324d64d1", "createdBy": "9db11c0c-5a40-4ca0-93b0-84a5b49e0927", + "createdAt": 1779342381510}, "id": "impact-python-client-workspace1", "conversion": + {"state": "UP_TO_DATE"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '1127' + Content-Type: + - application/json + method: PUT + uri: /user/test-user-uniqid/impact/api/workspaces/impact-python-client-workspace1 + response: + body: + string: '{"definition": {"name": "impact-python-client-workspace1", "description": + "", "defaultProjectId": "46e51f746c53db674d0d71cdcc7a085f81d7c3c9", "projects": + [{"reference": {"id": "46e51f746c53db674d0d71cdcc7a085f81d7c3c9"}, "disabled": + false, "disabledContent": []}, {"reference": {"id": "bb38b2a12a74e428af4f35a1021d2183cfa5773d"}, + "disabled": true, "disabledContent": []}], "dependencies": [{"reference": + {"id": "fec43f77925949bd7e7c0f10ac49ebc1189dc840", "name": "Modelica", "version": + "3.2.3"}, "disabled": true, "disabledContent": []}, {"reference": {"id": "ac04a5da97bc2e11bffb7f41b2485da347846df6", + "name": "Modelica", "version": "4.0.0"}, "disabled": true, "disabledContent": + []}, {"reference": {"id": "03a291276bb1f38120a5d4d2c4068a2d3d286274", "name": + "Modelica", "version": "4.1.0"}, "disabled": false, "disabledContent": []}, + {"reference": {"id": "bb38b2a12a74e428af4f35a1021d2183cfa5773d"}, "disabled": + false, "disabledContent": []}], "format": "1.0.0", "guid": "492577d45b924739a04cda98324d64d1", + "createdBy": "test-user-uniqid", "createdAt": 1779342381510}, "id": "impact-python-client-workspace1", + "conversion": {"state": "UP_TO_DATE"}}' + headers: + Connection: + - keep-alive + Content-Type: + - application/json + Transfer-Encoding: + - chunked + content-length: + - '1169' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + method: GET + uri: /user/test-user-uniqid/impact/api/workspaces/impact-python-client-workspace1 + response: + body: + string: '{"definition": {"name": "impact-python-client-workspace1", "description": + "", "defaultProjectId": "46e51f746c53db674d0d71cdcc7a085f81d7c3c9", "projects": + [{"reference": {"id": "46e51f746c53db674d0d71cdcc7a085f81d7c3c9"}, "disabled": + false, "disabledContent": []}, {"reference": {"id": "bb38b2a12a74e428af4f35a1021d2183cfa5773d"}, + "disabled": true, "disabledContent": []}], "dependencies": [{"reference": + {"id": "fec43f77925949bd7e7c0f10ac49ebc1189dc840", "name": "Modelica", "version": + "3.2.3"}, "disabled": true, "disabledContent": []}, {"reference": {"id": "ac04a5da97bc2e11bffb7f41b2485da347846df6", + "name": "Modelica", "version": "4.0.0"}, "disabled": true, "disabledContent": + []}, {"reference": {"id": "03a291276bb1f38120a5d4d2c4068a2d3d286274", "name": + "Modelica", "version": "4.1.0"}, "disabled": false, "disabledContent": []}, + {"reference": {"id": "bb38b2a12a74e428af4f35a1021d2183cfa5773d"}, "disabled": + false, "disabledContent": []}], "format": "1.0.0", "guid": "492577d45b924739a04cda98324d64d1", + "createdBy": "test-user-uniqid", "createdAt": 1779342381510}, "id": "impact-python-client-workspace1", + "conversion": {"state": "UP_TO_DATE"}}' + headers: + Connection: + - keep-alive + Content-Type: + - application/json + Transfer-Encoding: + - chunked + content-length: + - '1169' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + method: GET + uri: /user/test-user-uniqid/impact/api/workspaces + response: + body: + string: '{"data": {"items": [{"definition": {"name": "test", "description": + "", "defaultProjectId": "fe964271cbc1f5c5739e3b4e485ed329fd862a77", "projects": + [{"reference": {"id": "fe964271cbc1f5c5739e3b4e485ed329fd862a77"}, "disabled": + false, "disabledContent": []}], "dependencies": [{"reference": {"id": "fec43f77925949bd7e7c0f10ac49ebc1189dc840", + "name": "Modelica", "version": "3.2.3"}, "disabled": true, "disabledContent": + []}, {"reference": {"id": "ac04a5da97bc2e11bffb7f41b2485da347846df6", "name": + "Modelica", "version": "4.0.0"}, "disabled": true, "disabledContent": []}, + {"reference": {"id": "03a291276bb1f38120a5d4d2c4068a2d3d286274", "name": "Modelica", + "version": "4.1.0"}, "disabled": false, "disabledContent": []}], "format": + "1.0.0", "guid": "a81ae267561f455c98bc6710c23176f9", "createdBy": "test-user-uniqid", + "createdAt": 1779271558352}, "id": "test", "conversion": {"state": "UP_TO_DATE"}}, + {"definition": {"name": "impact-python-client-workspace1", "description": + "", "defaultProjectId": "46e51f746c53db674d0d71cdcc7a085f81d7c3c9", "projects": + [{"reference": {"id": "46e51f746c53db674d0d71cdcc7a085f81d7c3c9"}, "disabled": + false, "disabledContent": []}, {"reference": {"id": "bb38b2a12a74e428af4f35a1021d2183cfa5773d"}, + "disabled": true, "disabledContent": []}], "dependencies": [{"reference": + {"id": "fec43f77925949bd7e7c0f10ac49ebc1189dc840", "name": "Modelica", "version": + "3.2.3"}, "disabled": true, "disabledContent": []}, {"reference": {"id": "ac04a5da97bc2e11bffb7f41b2485da347846df6", + "name": "Modelica", "version": "4.0.0"}, "disabled": true, "disabledContent": + []}, {"reference": {"id": "03a291276bb1f38120a5d4d2c4068a2d3d286274", "name": + "Modelica", "version": "4.1.0"}, "disabled": false, "disabledContent": []}, + {"reference": {"id": "bb38b2a12a74e428af4f35a1021d2183cfa5773d"}, "disabled": + false, "disabledContent": []}], "format": "1.0.0", "guid": "492577d45b924739a04cda98324d64d1", + "createdBy": "test-user-uniqid", "createdAt": 1779342381510}, "id": "impact-python-client-workspace1", + "conversion": {"state": "UP_TO_DATE"}}]}}' + headers: + Connection: + - keep-alive + Content-Type: + - application/json + Transfer-Encoding: + - chunked + content-length: + - '2092' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + method: GET + uri: /user/test-user-uniqid/impact/api/workspaces/test + response: + body: + string: '{"definition": {"name": "test", "description": "", "defaultProjectId": + "fe964271cbc1f5c5739e3b4e485ed329fd862a77", "projects": [{"reference": {"id": + "fe964271cbc1f5c5739e3b4e485ed329fd862a77"}, "disabled": false, "disabledContent": + []}], "dependencies": [{"reference": {"id": "fec43f77925949bd7e7c0f10ac49ebc1189dc840", + "name": "Modelica", "version": "3.2.3"}, "disabled": true, "disabledContent": + []}, {"reference": {"id": "ac04a5da97bc2e11bffb7f41b2485da347846df6", "name": + "Modelica", "version": "4.0.0"}, "disabled": true, "disabledContent": []}, + {"reference": {"id": "03a291276bb1f38120a5d4d2c4068a2d3d286274", "name": "Modelica", + "version": "4.1.0"}, "disabled": false, "disabledContent": []}], "format": + "1.0.0", "guid": "a81ae267561f455c98bc6710c23176f9", "createdBy": "test-user-uniqid", + "createdAt": 1779271558352}, "id": "test", "conversion": {"state": "UP_TO_DATE"}}' + headers: + Connection: + - keep-alive + Content-Type: + - application/json + Transfer-Encoding: + - chunked + content-length: + - '898' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + method: GET + uri: /user/test-user-uniqid/impact/api/workspaces/test + response: + body: + string: '{"definition": {"name": "test", "description": "", "defaultProjectId": + "fe964271cbc1f5c5739e3b4e485ed329fd862a77", "projects": [{"reference": {"id": + "fe964271cbc1f5c5739e3b4e485ed329fd862a77"}, "disabled": false, "disabledContent": + []}], "dependencies": [{"reference": {"id": "fec43f77925949bd7e7c0f10ac49ebc1189dc840", + "name": "Modelica", "version": "3.2.3"}, "disabled": true, "disabledContent": + []}, {"reference": {"id": "ac04a5da97bc2e11bffb7f41b2485da347846df6", "name": + "Modelica", "version": "4.0.0"}, "disabled": true, "disabledContent": []}, + {"reference": {"id": "03a291276bb1f38120a5d4d2c4068a2d3d286274", "name": "Modelica", + "version": "4.1.0"}, "disabled": false, "disabledContent": []}], "format": + "1.0.0", "guid": "a81ae267561f455c98bc6710c23176f9", "createdBy": "test-user-uniqid", + "createdAt": 1779271558352}, "id": "test", "conversion": {"state": "UP_TO_DATE"}}' + headers: + Connection: + - keep-alive + Content-Type: + - application/json + Transfer-Encoding: + - chunked + content-length: + - '898' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + method: GET + uri: /user/test-user-uniqid/impact/api/workspaces/impact-python-client-workspace1 + response: + body: + string: '{"definition": {"name": "impact-python-client-workspace1", "description": + "", "defaultProjectId": "46e51f746c53db674d0d71cdcc7a085f81d7c3c9", "projects": + [{"reference": {"id": "46e51f746c53db674d0d71cdcc7a085f81d7c3c9"}, "disabled": + false, "disabledContent": []}, {"reference": {"id": "bb38b2a12a74e428af4f35a1021d2183cfa5773d"}, + "disabled": true, "disabledContent": []}], "dependencies": [{"reference": + {"id": "fec43f77925949bd7e7c0f10ac49ebc1189dc840", "name": "Modelica", "version": + "3.2.3"}, "disabled": true, "disabledContent": []}, {"reference": {"id": "ac04a5da97bc2e11bffb7f41b2485da347846df6", + "name": "Modelica", "version": "4.0.0"}, "disabled": true, "disabledContent": + []}, {"reference": {"id": "03a291276bb1f38120a5d4d2c4068a2d3d286274", "name": + "Modelica", "version": "4.1.0"}, "disabled": false, "disabledContent": []}, + {"reference": {"id": "bb38b2a12a74e428af4f35a1021d2183cfa5773d"}, "disabled": + false, "disabledContent": []}], "format": "1.0.0", "guid": "492577d45b924739a04cda98324d64d1", + "createdBy": "test-user-uniqid", "createdAt": 1779342381510}, "id": "impact-python-client-workspace1", + "conversion": {"state": "UP_TO_DATE"}}' + headers: + Connection: + - keep-alive + Content-Type: + - application/json + Transfer-Encoding: + - chunked + content-length: + - '1169' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + method: GET + uri: /user/test-user-uniqid/impact/api/workspaces/impact-python-client-workspace1/projects + response: + body: + string: '{"data": {"items": [{"id": "46e51f746c53db674d0d71cdcc7a085f81d7c3c9", + "definition": {"name": "Impact-python-client-workspace1", "format": "1.0.0", + "dependencies": [{"name": "Modelica", "versionSpecifier": "4.1.0"}], "content": + [{"relpath": "Resources/Views", "contentType": "VIEWS", "defaultDisabled": + false, "id": "fcafa26f9a464f38969f72b73d875bb9"}, {"relpath": "Resources/Favorites", + "contentType": "FAVORITES", "defaultDisabled": false, "id": "5f3f0f7823484be6b3bd0d8300580d34"}, + {"relpath": "Resources/CustomFunctions", "contentType": "CUSTOM_FUNCTIONS", + "defaultDisabled": false, "id": "8af2bd44145c4babb713e1978d4d8df4"}, {"relpath": + "Resources/Custom", "contentType": "GENERIC", "defaultDisabled": false, "id": + "5e77621e4ee84b25aa5db0dc65da93a1"}, {"relpath": "ReferenceResults", "contentType": + "REFERENCE_RESULTS", "defaultDisabled": false, "id": "c8ef94924b124178bb86dfca9f3b205f"}, + {"relpath": "Resources/ExperimentDefinitions", "contentType": "EXPERIMENT_DEFINITIONS", + "defaultDisabled": false, "id": "f84068767a7e4e448cace8a5399c3fb7"}], "executionOptions": + []}, "projectType": "LOCAL", "storageLocation": "USERSPACE"}]}}' + headers: + Connection: + - keep-alive + Content-Type: + - application/json + Transfer-Encoding: + - chunked + content-length: + - '1067' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + method: DELETE + uri: /user/test-user-uniqid/impact/api/projects/46e51f746c53db674d0d71cdcc7a085f81d7c3c9 + response: + body: + string: '{"id": "46e51f746c53db674d0d71cdcc7a085f81d7c3c9", "definition": {"name": + "Impact-python-client-workspace1", "format": "1.0.0", "dependencies": [{"name": + "Modelica", "versionSpecifier": "4.1.0"}], "content": [{"relpath": "Resources/Views", + "contentType": "VIEWS", "defaultDisabled": false, "id": "fcafa26f9a464f38969f72b73d875bb9"}, + {"relpath": "Resources/Favorites", "contentType": "FAVORITES", "defaultDisabled": + false, "id": "5f3f0f7823484be6b3bd0d8300580d34"}, {"relpath": "Resources/CustomFunctions", + "contentType": "CUSTOM_FUNCTIONS", "defaultDisabled": false, "id": "8af2bd44145c4babb713e1978d4d8df4"}, + {"relpath": "Resources/Custom", "contentType": "GENERIC", "defaultDisabled": + false, "id": "5e77621e4ee84b25aa5db0dc65da93a1"}, {"relpath": "ReferenceResults", + "contentType": "REFERENCE_RESULTS", "defaultDisabled": false, "id": "c8ef94924b124178bb86dfca9f3b205f"}, + {"relpath": "Resources/ExperimentDefinitions", "contentType": "EXPERIMENT_DEFINITIONS", + "defaultDisabled": false, "id": "f84068767a7e4e448cace8a5399c3fb7"}], "executionOptions": + []}, "projectType": "LOCAL", "storageLocation": "USERSPACE"}' + headers: + Connection: + - keep-alive + Content-Type: + - application/json + Transfer-Encoding: + - chunked + content-length: + - '1046' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + method: DELETE + uri: /user/test-user-uniqid/impact/api/workspaces/impact-python-client-workspace1 + response: + body: + string: '' + headers: + Connection: + - keep-alive + Content-Type: + - application/json + status: + code: 200 + message: OK +version: 1 diff --git a/tests/impact/client/entities/test_workspace.py b/tests/impact/client/entities/test_workspace.py index fbefcd92..da846927 100644 --- a/tests/impact/client/entities/test_workspace.py +++ b/tests/impact/client/entities/test_workspace.py @@ -535,6 +535,25 @@ def test_get_all_dependencies(self, client_helper: ClientHelper): assert len(dependencies) == 1 assert dependencies[0].name == "Modelica" + @pytest.mark.vcr() + def test_add_dependencies(self, client_helper: ClientHelper): + workspace = client_helper.workspace + project = workspace.create_project(IDs.PROJECT_NAME_PRIMARY) + workspace.add_dependencies([project]) + dep_ids = [entry.id for entry in workspace.definition.dependencies] + assert project.id in dep_ids + + @pytest.mark.vcr() + def test_add_dependencies_disables_existing_entry_with_same_name( + self, client_helper: ClientHelper + ): + workspace = client_helper.workspace + project = workspace.create_project(IDs.PROJECT_NAME_PRIMARY) + workspace.add_dependencies([project]) + project_entries = workspace.definition.projects + existing_entry = next(e for e in project_entries if e.id == project.id) + assert existing_entry.disabled + @pytest.mark.vcr() def test_create_project(self, client_helper: ClientHelper): workspace = client_helper.workspace