Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix docs for offset in get_histories and add test #486

Merged
merged 5 commits into from
Jun 2, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
add test of get_histories: limit and offset
bernt-matthias committed Jun 1, 2024
commit 37c6f05e0f0637a92b9f5fd2868776e6c88b3e9c
9 changes: 9 additions & 0 deletions bioblend/_tests/TestGalaxyHistories.py
Original file line number Diff line number Diff line change
@@ -70,6 +70,15 @@ def test_get_histories(self):
all_histories = self.gi.histories.get_histories()
assert len(all_histories) > 0

# Test limit and offset
first = self.gi.histories.get_histories(limit=1)
others = self.gi.histories.get_histories(offset=1)
assert len(others) > 0 # guess the test makes more sense with at least 2 histories
bernt-matthias marked this conversation as resolved.
Show resolved Hide resolved
assert [h["id"] for h in all_histories] == [h["id"] for h in first] + [h["id"] for h in others]

out_of_limit = self.gi.histories.get_histories(offset=1000000)
assert out_of_limit == []

# Check whether id is present, when searched by name
histories = self.gi.histories.get_histories(name=self.default_history_name)
assert len([h for h in histories if h["id"] == self.history["id"]]) == 1