Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
lpereiracgn committed Dec 10, 2024
1 parent 64cd8b5 commit 2a06f98
Showing 1 changed file with 3 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 2a06f98

Please sign in to comment.