diff --git a/cads_api_client/legacy_api_client.py b/cads_api_client/legacy_api_client.py index e7a980d..a5f9458 100644 --- a/cads_api_client/legacy_api_client.py +++ b/cads_api_client/legacy_api_client.py @@ -215,9 +215,8 @@ def workflow(self, code, *args, **kwargs): def status(self, context: Any = None) -> dict[str, list[str]]: status = collections.defaultdict(list) - for message in self.client._catalogue_api.messages.json_dict.get( - "messages", [] - ): + messages = self.client._catalogue_api.messages.json_dict.get("messages", []) + for message in messages: status[message["severity"]].append(message["content"]) return dict(status) diff --git a/tests/integration_test_10_catalogue.py b/tests/integration_test_10_catalogue.py index 9477e6c..8c6198b 100644 --- a/tests/integration_test_10_catalogue.py +++ b/tests/integration_test_10_catalogue.py @@ -13,7 +13,7 @@ def test_catalogue_collections(api_anon_client: ApiClient) -> None: assert collections.next is not None collection_ids = list(collections.collection_ids) - while len(collection_ids) != collections.json_dict["numberMatched"]: + while len(collection_ids) != collections.json["numberMatched"]: assert (next_collections := collections.next) is not None collections = next_collections collection_ids.extend(collections.collection_ids) @@ -60,7 +60,7 @@ def test_catalogue_collection_id(collection: Collection) -> None: def test_catalogue_collection_json(collection: Collection) -> None: - assert isinstance(collection.json_dict, dict) + assert isinstance(collection.json, dict) def test_catalogue_collection_process(collection: Collection) -> None: diff --git a/tests/test_10_processing.py b/tests/test_10_processing.py index 4693dea..bb85594 100644 --- a/tests/test_10_processing.py +++ b/tests/test_10_processing.py @@ -359,7 +359,7 @@ def responses_add() -> None: @responses.activate def test_catalogue_collections(cat: catalogue.Catalogue) -> None: responses_add() - assert cat.get_collections().json_dict == COLLECTIONS_JSON + assert cat.get_collections().json == COLLECTIONS_JSON collection = cat.get_collection(COLLECTION_ID) assert collection.response.json() == COLLECTION_JSON diff --git a/tests/test_40_results.py b/tests/test_40_results.py index 0086284..91e98ed 100644 --- a/tests/test_40_results.py +++ b/tests/test_40_results.py @@ -81,7 +81,7 @@ def test_results_content_type(results: Results) -> None: def test_results_json(results: Results) -> None: - assert results.json_dict == RESULTS_JSON + assert results.json == RESULTS_JSON def test_results_location(results: Results) -> None: