Skip to content
This repository has been archived by the owner on Nov 19, 2024. It is now read-only.

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
malmans2 committed Nov 7, 2024
1 parent b4fe797 commit 522467b
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 7 deletions.
5 changes: 2 additions & 3 deletions cads_api_client/legacy_api_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
4 changes: 2 additions & 2 deletions tests/integration_test_10_catalogue.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion tests/test_10_processing.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tests/test_40_results.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 522467b

Please sign in to comment.