diff --git a/server/benchmark/tests/test_.py b/server/benchmark/tests/test_.py index b8cc5e26c..6ed863634 100644 --- a/server/benchmark/tests/test_.py +++ b/server/benchmark/tests/test_.py @@ -283,10 +283,10 @@ def test_generic_get_benchmark_list(self): @parameterized.expand([ ({"name": "bmk2"}, 1), - ({"name": "string", "owner": 3}, 1), + ({"name": "bmk2", "owner": None}, 1), # id assigned dynamically ({"name": "nonexistent"}, 0), ({"is_valid": True}, 2), - ({"data_preparation_mlcube": 2}, 1), + ({"data_preparation_mlcube": None}, 1), # id assigned dinamically ]) def test_get_with_query_params(self, query_dict, expected_num_results): # Arrange @@ -295,11 +295,17 @@ def test_get_with_query_params(self, query_dict, expected_num_results): self.ref_model["id"], self.prep["id"], self.eval["id"], name="bmk2" ) benchmark = self.create_benchmark(benchmark).data + if 'owner' in query_dict: + query_dict['owner'] = benchmark['owner'] + if 'data_preparation_mlcube' in query_dict: + query_dict['data_preparation_mlcube'] = self.prep['id'] query_str = "&".join([f"{k}={v}" for k, v in query_dict.items()]) # Act query_url = self.url + f"?{query_str}" response = self.client.get(query_url) + print(query_url, response.status_code, response.data['results']) + print("Unfiltered Query:", self.client.get(self.url).data['results']) # Assert self.assertEqual(response.status_code, status.HTTP_200_OK)