Loading lib/galaxy/managers/quotas.py +1 −1 Original line number Diff line number Diff line Loading @@ -97,7 +97,7 @@ class QuotaManager: return None try: return util.size_to_bytes(amount) except AssertionError: except ValueError: return False def rename_quota(self, quota, params) -> str: Loading test/integration/test_quota.py +15 −0 Original line number Diff line number Diff line Loading @@ -148,6 +148,21 @@ class QuotaIntegrationTestCase(integration_util.IntegrationTestCase): show_response = self._get(f"quotas/{quota_id}") self._assert_status_code_is(show_response, 400) def test_400_when_invalid_amount(self): invalid_amount = "" quota_name = "invalid-amount-id" payload = { "name": quota_name, "description": f"Quota {quota_name} description", "amount": invalid_amount, "operation": "=", "default": "no", "in_users": [], "in_groups": [], } create_response = self._post("quotas", data=payload, json=True) self._assert_status_code_is(create_response, 400) def _create_quota_with_name(self, quota_name: str, is_default: bool = False): payload = self._build_quota_payload_with_name(quota_name, is_default) create_response = self._post("quotas", data=payload, json=True) Loading Loading
lib/galaxy/managers/quotas.py +1 −1 Original line number Diff line number Diff line Loading @@ -97,7 +97,7 @@ class QuotaManager: return None try: return util.size_to_bytes(amount) except AssertionError: except ValueError: return False def rename_quota(self, quota, params) -> str: Loading
test/integration/test_quota.py +15 −0 Original line number Diff line number Diff line Loading @@ -148,6 +148,21 @@ class QuotaIntegrationTestCase(integration_util.IntegrationTestCase): show_response = self._get(f"quotas/{quota_id}") self._assert_status_code_is(show_response, 400) def test_400_when_invalid_amount(self): invalid_amount = "" quota_name = "invalid-amount-id" payload = { "name": quota_name, "description": f"Quota {quota_name} description", "amount": invalid_amount, "operation": "=", "default": "no", "in_users": [], "in_groups": [], } create_response = self._post("quotas", data=payload, json=True) self._assert_status_code_is(create_response, 400) def _create_quota_with_name(self, quota_name: str, is_default: bool = False): payload = self._build_quota_payload_with_name(quota_name, is_default) create_response = self._post("quotas", data=payload, json=True) Loading