From c0cbe7d435b524929141e79e4f827f41406b0f8f Mon Sep 17 00:00:00 2001 From: Daniel Chang Date: Tue, 11 Jun 2024 10:33:25 -0700 Subject: [PATCH] =?UTF-8?q?Revert=20"Revert=20"Pointing=20to=20the=20legac?= =?UTF-8?q?y=20endpoint=20for=20model=20configs=20for=20now.=20(#=E2=80=A6?= =?UTF-8?q?"=20(#91)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 8def5f6338ebbf06bae21722a86935c0b26eb098. --- 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