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

try to add test for quota update #479

Closed
Closed
Changes from all commits
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
25 changes: 25 additions & 0 deletions bioblend/_tests/TestGalaxyQuotas.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,31 @@ def test_update_quota(self):
assert quota["operation"] == "-"
assert quota["description"] == "asdf"

def test_update_quota_nondefault(self):
"""
try to update a non-default quota (and leave it non-default)
"""
# 1st make it non-default
response = self.gi.quotas.update_quota(
self.quota["id"],
name=self.quota_name,
description="testing",
default="no",
operation="=",
amount="100 GB",
)
assert f"has been renamed to '{self.quota_name}'" in response
assert f"Quota '{self.quota_name}' is no longer the default for registered users." in response

# update it leaving it non-default
response = self.gi.quotas.update_quota(
self.quota["id"],
name=self.quota_name + "-updated",
)
assert f"""Quota '{self.quota_name}' has been renamed to '{self.quota_name}-updated'""" in response
quota = self.gi.quotas.show_quota(self.quota["id"])
assert quota["default"] == "no"

def test_delete_undelete_quota(self):
self.gi.quotas.update_quota(self.quota["id"], default="no")
response = self.gi.quotas.delete_quota(self.quota["id"])
Expand Down
Loading