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 c104a3b commit 6718fb4
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
5 changes: 3 additions & 2 deletions tests/tests_integration/test_api/test_simulators/seed/data.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import time

data_set_id = 1521375514069
development_data_set_id = 97552494921583
#data_set_id = 1521375514069
#development_data_set_id = 97552494921583
data_set_id = 97552494921583

resource_names = {
"simulator_external_id": "py_sdk_integration_tests",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,15 @@ def seed_simulator_integration(cognite_client: CogniteClient, seed_simulator) ->

@pytest.fixture
def seed_simulator_models(cognite_client: CogniteClient, seed_simulator_integration) -> None:
models = cognite_client.simulators.models.list()
model_seed = list(filter(lambda x: x.external_id == simulator_model["externalId"], models))

if len(model_seed) > 0:
cognite_client.post(
f"/api/v1/projects/{cognite_client.config.project}/simulators/models/delete",
json={"items": [{"id": model_seed[0].id}]}, # Post actual simulator models here
)

cognite_client.post(
f"/api/v1/projects/{cognite_client.config.project}/simulators/models",
json={"items": [simulator_model]}, # Post actual simulator models here
Expand Down Expand Up @@ -185,10 +194,10 @@ def test_retrieve_model_revision(self, cognite_client: CogniteClient, seed_resou
)
assert model is not None
assert model.external_id == seed_resource_names["simulator_model_external_id"]
"""

@pytest.mark.usefixtures(
"seed_resource_names", "seed_simulator", "seed_simulator_routine_revisions", "delete_simulator"
"seed_resource_names", "seed_simulator_routine_revisions"
)
class TestSimulatorRoutines:
def test_list_routines(self, cognite_client: CogniteClient) -> None:
Expand All @@ -200,4 +209,3 @@ def test_list_routine_revisions(self, cognite_client: CogniteClient) -> None:
assert revisions[0].configuration is not None
assert revisions[0].script is not None
assert len(revisions) > 0
"""

0 comments on commit 6718fb4

Please sign in to comment.