From 50aff58c3965316cbdf329d8e9e4674ccb99fc94 Mon Sep 17 00:00:00 2001 From: Derek Vince Date: Fri, 7 Jun 2024 16:06:41 -0400 Subject: [PATCH] Pointing to the legacy endpoint for model configs for now. (#89) Co-authored-by: Tom Szendrey --- service/utils/tds.py | 2 +- tests/integration/test_calibrate.py | 2 +- tests/integration/test_ensemble_calibrate.py | 4 +++- tests/integration/test_ensemble_simulate.py | 4 +++- tests/integration/test_optimize.py | 2 +- tests/integration/test_simulate.py | 2 +- tests/test_conversions.py | 20 +++++++++++++++----- 7 files changed, 25 insertions(+), 11 deletions(-) diff --git a/service/utils/tds.py b/service/utils/tds.py index 27f9f95..35b99e6 100644 --- a/service/utils/tds.py +++ b/service/utils/tds.py @@ -22,7 +22,7 @@ TDS_PASSWORD = settings.TDS_PASSWORD TDS_SIMULATIONS = "/simulations" TDS_DATASETS = "/datasets" -TDS_CONFIGURATIONS = "/model-configurations" +TDS_CONFIGURATIONS = "/model-configurations-legacy" def tds_session(): diff --git a/tests/integration/test_calibrate.py b/tests/integration/test_calibrate.py index 3f461a0..fa2de11 100644 --- a/tests/integration/test_calibrate.py +++ b/tests/integration/test_calibrate.py @@ -47,7 +47,7 @@ def test_calibrate_example( requests_mock.put( f"{TDS_URL}/simulations/{simulation_id}", json={"status": "success"} ) - requests_mock.get(f"{TDS_URL}/model-configurations/{config_id}", json=model) + requests_mock.get(f"{TDS_URL}/model-configurations-legacy/{config_id}", json=model) worker.work(burst=True) diff --git a/tests/integration/test_ensemble_calibrate.py b/tests/integration/test_ensemble_calibrate.py index 26c3d13..5a26fa9 100644 --- a/tests/integration/test_ensemble_calibrate.py +++ b/tests/integration/test_ensemble_calibrate.py @@ -19,7 +19,9 @@ def test_ensemble_calibrate_example( ] for config_id in config_ids: model = json.loads(example_context["fetch"](config_id + ".json")) - requests_mock.get(f"{TDS_URL}/model-configurations/{config_id}", json=model) + requests_mock.get( + f"{TDS_URL}/model-configurations-legacy/{config_id}", json=model + ) dataset_id = example_context["request"]["dataset"]["id"] filename = example_context["request"]["dataset"]["filename"] diff --git a/tests/integration/test_ensemble_simulate.py b/tests/integration/test_ensemble_simulate.py index 37f6725..85b1aff 100644 --- a/tests/integration/test_ensemble_simulate.py +++ b/tests/integration/test_ensemble_simulate.py @@ -19,7 +19,9 @@ def test_ensemble_simulate_example( ] for config_id in config_ids: model = json.loads(example_context["fetch"](config_id + ".json")) - requests_mock.get(f"{TDS_URL}/model-configurations/{config_id}", json=model) + requests_mock.get( + f"{TDS_URL}/model-configurations-legacy/{config_id}", json=model + ) requests_mock.post(f"{TDS_URL}/simulations", json={"id": str(job_id)}) diff --git a/tests/integration/test_optimize.py b/tests/integration/test_optimize.py index 9835e3f..3485f04 100644 --- a/tests/integration/test_optimize.py +++ b/tests/integration/test_optimize.py @@ -37,7 +37,7 @@ def test_optimize_example( requests_mock.put( f"{TDS_URL}/simulations/{simulation_id}", json={"status": "success"} ) - requests_mock.get(f"{TDS_URL}/model-configurations/{config_id}", json=model) + requests_mock.get(f"{TDS_URL}/model-configurations-legacy/{config_id}", json=model) worker.work(burst=True) diff --git a/tests/integration/test_simulate.py b/tests/integration/test_simulate.py index 7a26127..e3f59c4 100644 --- a/tests/integration/test_simulate.py +++ b/tests/integration/test_simulate.py @@ -38,7 +38,7 @@ def test_simulate_example( requests_mock.put( f"{TDS_URL}/simulations/{simulation_id}", json={"status": "success"} ) - requests_mock.get(f"{TDS_URL}/model-configurations/{config_id}", json=model) + requests_mock.get(f"{TDS_URL}/model-configurations-legacy/{config_id}", json=model) worker.work(burst=True) diff --git a/tests/test_conversions.py b/tests/test_conversions.py index 9a197cc..aa32ddb 100644 --- a/tests/test_conversions.py +++ b/tests/test_conversions.py @@ -42,7 +42,9 @@ def test_example_conversion(self, example_context, requests_mock): config_id = example_context["request"]["model_config_id"] model = json.loads(example_context["fetch"](config_id + ".json")) - requests_mock.get(f"{TDS_URL}/model-configurations/{config_id}", json=model) + requests_mock.get( + f"{TDS_URL}/model-configurations-legacy/{config_id}", json=model + ) ### Act and Assert @@ -60,7 +62,9 @@ def test_example_conversion(self, example_context, requests_mock): config_id = example_context["request"]["model_config_id"] model = json.loads(example_context["fetch"](config_id + ".json")) - requests_mock.get(f"{TDS_URL}/model-configurations/{config_id}", json=model) + requests_mock.get( + f"{TDS_URL}/model-configurations-legacy/{config_id}", json=model + ) dataset_id = example_context["request"]["dataset"]["id"] filename = example_context["request"]["dataset"]["filename"] @@ -89,7 +93,9 @@ def test_example_conversion(self, example_context, requests_mock): ] for config_id in config_ids: model = json.loads(example_context["fetch"](config_id + ".json")) - requests_mock.get(f"{TDS_URL}/model-configurations/{config_id}", json=model) + requests_mock.get( + f"{TDS_URL}/model-configurations-legacy/{config_id}", json=model + ) ### Act and Assert @@ -110,7 +116,9 @@ def test_example_conversion(self, example_context, requests_mock): ] for config_id in config_ids: model = json.loads(example_context["fetch"](config_id + ".json")) - requests_mock.get(f"{TDS_URL}/model-configurations/{config_id}", json=model) + requests_mock.get( + f"{TDS_URL}/model-configurations-legacy/{config_id}", json=model + ) dataset_id = example_context["request"]["dataset"]["id"] filename = example_context["request"]["dataset"]["filename"] @@ -137,7 +145,9 @@ def test_example_conversion(self, example_context, requests_mock): config_id = example_context["request"]["model_config_id"] model = json.loads(example_context["fetch"](config_id + ".json")) - requests_mock.get(f"{TDS_URL}/model-configurations/{config_id}", json=model) + requests_mock.get( + f"{TDS_URL}/model-configurations-legacy/{config_id}", json=model + ) ### Act and Assert