From 15c8f4bb87ce7c10676b662ac0e62a44403ed222 Mon Sep 17 00:00:00 2001 From: Boris-Bergsma Date: Thu, 19 Dec 2024 09:48:29 +0100 Subject: [PATCH] fix last tool tests --- swarm_copy_tests/tools/test_electrophys_tool.py | 12 ++++++------ .../tools/test_morphology_features_tool.py | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/swarm_copy_tests/tools/test_electrophys_tool.py b/swarm_copy_tests/tools/test_electrophys_tool.py index bb02b1f..612c84f 100644 --- a/swarm_copy_tests/tools/test_electrophys_tool.py +++ b/swarm_copy_tests/tools/test_electrophys_tool.py @@ -61,9 +61,9 @@ async def test_arun(self, httpx_mock): ) response = await tool.arun() assert isinstance(response, dict) - assert len(response.keys()) == 1 + assert len(response["feature_dict"].keys()) == 1 assert ( - len(response["step_0"].keys()) + len(response["feature_dict"]["step_0"].keys()) == 2 # mean_frequency + 1 for stimulus current added manually ) @@ -112,9 +112,9 @@ async def test_arun_with_amplitude(self, httpx_mock): ) response = await tool.arun() assert isinstance(response, dict) - assert len(response.keys()) == 1 + assert len(response["feature_dict"].keys()) == 1 assert ( - len(response["step_0.25"].keys()) + len(response["feature_dict"]["step_0.25"].keys()) == 2 # mean_frequency + 1 for stimulus current added manually ) @@ -163,9 +163,9 @@ async def test_arun_without_stimuli_types(self, httpx_mock): # Without stimuli types and calculated features response = await tool.arun() assert isinstance(response, dict) - assert len(response.keys()) == 1 + assert len(response["feature_dict"].keys()) == 1 assert ( - len(response["step_0"].keys()) + len(response["feature_dict"]["step_0"].keys()) == len(list(CALCULATED_FEATURES.__args__[0].__args__)) + 1 # 1 for stimulus current added manually ) diff --git a/swarm_copy_tests/tools/test_morphology_features_tool.py b/swarm_copy_tests/tools/test_morphology_features_tool.py index 34a1ca9..aef7808 100644 --- a/swarm_copy_tests/tools/test_morphology_features_tool.py +++ b/swarm_copy_tests/tools/test_morphology_features_tool.py @@ -50,7 +50,7 @@ async def test_arun(self, httpx_mock): response = await tool.arun() assert isinstance(response[0], dict) - assert len(response[0]) == 23 + assert len(response[0]["feature_dict"]) == 23 @pytest.mark.asyncio async def test_arun_errors_404(self, httpx_mock):