1
0
mirror of https://github.com/quay/quay.git synced 2026-01-29 08:42:15 +03:00
Files
quay/endpoints/api/test/test_organization.py
Kenny Lee Sin Cheong 72f7c64ed6 chore: update werkzeug and related package versions (PROJQUAY-5098) (#1982)
* chore: update werkzeug and related package versions (PROJQUAY-5098)

Path converter related change reference: https://github.com/pallets/werkzeug/issues/2506

* Update query count
2023-09-12 11:51:09 -04:00

47 lines
1.4 KiB
Python

from test.fixtures import *
import pytest
from data import model
from endpoints.api import api
from endpoints.api.organization import Organization, OrganizationCollaboratorList
from endpoints.api.test.shared import conduct_api_call
from endpoints.test.shared import client_with_identity
@pytest.mark.parametrize(
"expiration, expected_code",
[
(0, 200),
(100, 400),
(100000000000000000000, 400),
],
)
def test_change_tag_expiration(expiration, expected_code, app):
with client_with_identity("devtable", app) as cl:
conduct_api_call(
cl,
Organization,
"PUT",
{"orgname": "buynlarge"},
body={"tag_expiration_s": expiration},
expected_code=expected_code,
)
def test_get_organization_collaborators(app):
params = {"orgname": "buynlarge"}
with client_with_identity("devtable", app) as cl:
resp = conduct_api_call(cl, OrganizationCollaboratorList, "GET", params)
collaborator_names = [c["name"] for c in resp.json["collaborators"]]
assert "outsideorg" in collaborator_names
assert "devtable" not in collaborator_names
assert "reader" not in collaborator_names
for collaborator in resp.json["collaborators"]:
if collaborator["name"] == "outsideorg":
assert "orgrepo" in collaborator["repositories"]
assert "anotherorgrepo" not in collaborator["repositories"]