Skip to content

Commit

Permalink
Add test coverage for pagination
Browse files Browse the repository at this point in the history
  • Loading branch information
davelopez committed Jan 27, 2023
1 parent cd3aa08 commit 5be8fbc
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions lib/galaxy_test/api/test_storage_cleaner.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,15 @@ def _assert_monitoring_and_cleanup_for_discarded_resource(
assert len(paginated_items) == expected_discarded_item_count
assert sum([item["size"] for item in paginated_items]) == expected_total_size

# Check pagination
offset = 1
limit = 1
paginated_items_response = self._get(f"{discarded_storage_items_uri}?offset={offset}&limit={limit}")
self._assert_status_code_is_ok(paginated_items_response)
paginated_items = paginated_items_response.json()
assert len(paginated_items) == 1
assert paginated_items[0]["name"] == test_items[1].name

# Check listing order by
item_names_forward_order = [test_items[0].name, test_items[1].name, test_items[2].name]
item_names_reverse_order = list(reversed(item_names_forward_order))
Expand Down

0 comments on commit 5be8fbc

Please sign in to comment.