1
0
mirror of https://github.com/quay/quay.git synced 2025-07-28 20:22:05 +03:00

api: update the quota api so that it's more consistent with the other apis endpoints (PROJQUAY-2936) (#1221)

* api: update the quota api so that it's more consistent with the other apis (PROJQUAY-2936)

- Uodate the quota api to be more consistent with the rest of the
endpoints
- Handles some uncaught exceptions, such as division by zero
- Update some of the quota data models used by the api to take object
  references instead of names to make it easier to use
- Update table model naming conventions
- swagger operationid multiple nicknames
- Added more test cases for api
- Remove unused functions
- Update the UI for better UX, based on the api changes made

* quota: fix ui input form value

* quota: join quota type query

* Remove unused functions
This commit is contained in:
Kenny Lee Sin Cheong
2022-04-07 14:11:55 -04:00
committed by GitHub
parent a79f7b6f40
commit 896a3aab3a
27 changed files with 1339 additions and 1004 deletions

View File

@ -2107,9 +2107,11 @@ class TestListRepos(ApiTestCase):
def test_listrepos_asguest(self):
# Queries: Base + the list query
with assert_query_count(BASE_QUERY_COUNT + 1):
json = self.getJsonResponse(RepositoryList, params=dict(public=True))
self.assertEqual(len(json["repositories"]), 1)
# TODO: Add quota queries
with patch("features.QUOTA_MANAGEMENT", False):
with assert_query_count(BASE_QUERY_COUNT + 1):
json = self.getJsonResponse(RepositoryList, params=dict(public=True))
self.assertEqual(len(json["repositories"]), 1)
def assertPublicRepos(self, has_extras=False):
public_user = model.user.get_user("public")
@ -2173,13 +2175,15 @@ class TestListRepos(ApiTestCase):
self.login(ADMIN_ACCESS_USER)
# Queries: Base + the list query + the popularity and last modified queries + full perms load
with assert_query_count(BASE_LOGGEDIN_QUERY_COUNT + 5):
json = self.getJsonResponse(
RepositoryList,
params=dict(
namespace=ORGANIZATION, public=False, last_modified=True, popularity=True
),
)
# TODO: Add quota queries
with patch("features.QUOTA_MANAGEMENT", False):
with assert_query_count(BASE_LOGGEDIN_QUERY_COUNT + 5):
json = self.getJsonResponse(
RepositoryList,
params=dict(
namespace=ORGANIZATION, public=False, last_modified=True, popularity=True
),
)
self.assertGreater(len(json["repositories"]), 0)