From 2a06f9887ba8cea033aa0d018b2079ee00af7128 Mon Sep 17 00:00:00 2001 From: Luis Pereira Date: Tue, 10 Dec 2024 10:57:03 +0100 Subject: [PATCH] fix --- .../test_api/test_simulators/test_simulators.py | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/tests/tests_integration/test_api/test_simulators/test_simulators.py b/tests/tests_integration/test_api/test_simulators/test_simulators.py index 155cbcb5a..911582520 100644 --- a/tests/tests_integration/test_api/test_simulators/test_simulators.py +++ b/tests/tests_integration/test_api/test_simulators/test_simulators.py @@ -42,17 +42,12 @@ def seed_simulator(cognite_client: CogniteClient, seed_resource_names) -> None: simulator_external_id = seed_resource_names["simulator_external_id"] simulators = cognite_client.simulators.list() simulator_exists = len(list(filter(lambda x: x.external_id == simulator_external_id, simulators))) > 0 - if simulator_exists: + if not simulator_exists: cognite_client.post( - f"/api/v1/projects/{cognite_client.config.project}/simulators/delete", - json={"items": [{"externalId": seed_resource_names["simulator_external_id"]}]}, + f"/api/v1/projects/{cognite_client.config.project}/simulators", + json={"items": [simulator]}, ) - cognite_client.post( - f"/api/v1/projects/{cognite_client.config.project}/simulators", - json={"items": [simulator]}, - ) - @pytest.fixture def seed_simulator_integration(cognite_client: CogniteClient, seed_simulator) -> None: