diff --git a/COMPATIBILITY.md b/COMPATIBILITY.md index 4d45c271..92bcb0ad 100644 --- a/COMPATIBILITY.md +++ b/COMPATIBILITY.md @@ -51,17 +51,18 @@ In case you find any error, please [create a new issue](https://github.com/packi ## Project -| | GitHub | GitLab | Pagure | -| --------------------------- | :----: | :----: | :---------------------: | -| `change_token` | ✘ | ✔ | ✔ | -| `get_release` | ✔ | ✔ | ✘ | -| `get_latest_release` | ✔ | ✔ | ✘ | -| `is_private` | ✔ | ✔ | ✘ (may not be accurate) | -| `remove_user` | ✘ | ✘ | ✔ | -| `add_group` | ✘ | ✘ | ✔ | -| `remove_group` | ✘ | ✘ | ✔ | -| `which_groups_can_merge_pr` | ✘ | ✘ | ✔ | -| `get_pr_files_diff` | ✘ | ✘ | ✔ | +| | GitHub | GitLab | Pagure | +| ----------------------------- | :----: | :----: | :---------------------: | +| `change_token` | ✘ | ✔ | ✔ | +| `get_release` | ✔ | ✔ | ✘ | +| `get_latest_release` | ✔ | ✔ | ✘ | +| `is_private` | ✔ | ✔ | ✘ (may not be accurate) | +| `remove_user` | ✘ | ✘ | ✔ | +| `add_group` | ✘ | ✘ | ✔ | +| `remove_group` | ✘ | ✘ | ✔ | +| `which_groups_can_merge_pr` | ✘ | ✘ | ✔ | +| `get_pr_files_diff` | ✘ | ✘ | ✔ | +| `get_users_with_given_access` | ✘ | ✘ | ✔ | ## User @@ -76,3 +77,9 @@ In case you find any error, please [create a new issue](https://github.com/packi | | GitHub | GitLab | Pagure | | -------- | :----: | :----: | :----: | | `delete` | ✔ | ✔ | ✘ | + +## Service + +| | GitHub | GitLab | Pagure | +| ----------- | :----: | :----: | :----: | +| `get_group` | ✘ | ✘ | ✔ | diff --git a/ogr/abstract.py b/ogr/abstract.py index 0d56b87e..e68625c5 100644 --- a/ogr/abstract.py +++ b/ogr/abstract.py @@ -1369,6 +1369,12 @@ def list_projects( """ raise NotImplementedError + def get_group(self, group_name: str): + """ + Get a group by name. + """ + raise NotImplementedError + class GitProject(OgrAbstractClass): def __init__(self, repo: str, service: GitService, namespace: str) -> None: @@ -1528,6 +1534,16 @@ def can_merge_pr(self, username: str) -> bool: """ raise NotImplementedError() + def get_users_with_given_access(self, access_levels: list[AccessLevel]) -> set[str]: + """ + Args: + access_levels: list of access levels + + Returns: + set of users with given access levels + """ + raise NotImplementedError() + def add_user(self, user: str, access_level: AccessLevel) -> None: """ Add user to project. diff --git a/ogr/services/pagure/group.py b/ogr/services/pagure/group.py new file mode 100644 index 00000000..7eb7d177 --- /dev/null +++ b/ogr/services/pagure/group.py @@ -0,0 +1,24 @@ +# Copyright Contributors to the Packit project. +# SPDX-License-Identifier: MIT + +import logging + +from ogr.services import pagure as ogr_pagure + +logger = logging.getLogger(__name__) + + +class PagureGroup: + service: "ogr_pagure.PagureService" + + def __init__(self, name: str, raw_group: dict) -> None: + self.name = name + # see https://pagure.io/api/0/#groups-tab + self._raw_group = raw_group + + def __str__(self) -> str: + return f'PagureGroup(name="{self.name}")' + + @property + def members(self) -> list[str]: + return self._raw_group["members"] diff --git a/ogr/services/pagure/project.py b/ogr/services/pagure/project.py index 1deb6060..608377d5 100644 --- a/ogr/services/pagure/project.py +++ b/ogr/services/pagure/project.py @@ -3,7 +3,7 @@ import logging from collections.abc import Iterable -from typing import Optional +from typing import ClassVar, Optional from urllib.parse import urlparse from ogr.abstract import ( @@ -37,6 +37,14 @@ class PagureProject(BaseGitProject): service: "ogr_pagure.PagureService" + access_dict: ClassVar[dict] = { + AccessLevel.pull: "ticket", + AccessLevel.triage: "ticket", + AccessLevel.push: "commit", + AccessLevel.admin: "commit", + AccessLevel.maintain: "admin", + None: "", + } def __init__( self, @@ -229,7 +237,19 @@ def which_groups_can_merge_pr(self) -> set[str]: return groups def can_merge_pr(self, username) -> bool: - return username in self.who_can_merge_pr() + accounts_that_can_merge_pr = self.who_can_merge_pr() + + groups_that_can_merge_pr = self.which_groups_can_merge_pr() + accounts_that_can_merge_pr.update( + member + for group in groups_that_can_merge_pr + for member in self.service.get_group(group).members + ) + + logger.info( + f"All users (considering groups) that can merge PR: {accounts_that_can_merge_pr}", + ) + return username in accounts_that_can_merge_pr def request_access(self): raise OperationNotSupported("Not possible on Pagure") @@ -405,14 +425,6 @@ def add_user_or_group( access_level: Optional[AccessLevel], user_type: str, ) -> None: - access_dict = { - AccessLevel.pull: "ticket", - AccessLevel.triage: "ticket", - AccessLevel.push: "commit", - AccessLevel.admin: "commit", - AccessLevel.maintain: "admin", - None: "", - } response = self._call_project_api_raw( "git", "modifyacls", @@ -420,7 +432,7 @@ def add_user_or_group( data={ "user_type": user_type, "name": user, - "acl": access_dict[access_level], + "acl": self.access_dict[access_level], }, ) @@ -592,9 +604,75 @@ def get_contributors(self) -> set[str]: raise OperationNotSupported("Pagure doesn't provide list of contributors") def users_with_write_access(self) -> set[str]: - users_with_access = self.get_project_info()["access_users"] + return self._get_users_with_given_access(["commit", "admin", "owner"]) + + def get_users_with_given_access(self, access_levels: list[AccessLevel]) -> set[str]: + access_levels_pagure = [ + self.access_dict[access_level] for access_level in access_levels + ] + + # for AccessLevel.maintain get the maintainer as well + if AccessLevel.maintain in access_levels: + access_levels_pagure.append("owner") + + return self._get_users_with_given_access(access_levels_pagure) + + def _get_users_with_given_access(self, access_levels: list[str]) -> set[str]: + """ + Get all users (considering groups) with the access levels given by list. + + Arguments: + access_levels: list of access levels, e.g. ['commit', 'admin'] + """ + users = self._get_user_accounts_with_access(access_levels) + + # group cannot have owner access + group_accounts = self._get_group_accounts_with_access( + list(set(access_levels) - {"owner"}), + ) + + users.update( + member + for group in group_accounts + for member in self.service.get_group(group).members + ) + + logger.info( + f"All users (considering groups) with given access levels: {users}", + ) + return users + + def _get_entity_accounts_with_access( + self, + access_levels: list[str], + entity_type: str, + ) -> set[str]: + """ + Get the entity account names (users or groups) with the access levels given by the set. + + Arguments: + access_levels: list of access levels, e.g. ['commit', 'admin'] + entity_type: 'users' or 'groups' + """ + if entity_type not in ("users", "groups"): + raise OgrException( + f"Unsupported entity type {entity_type}: only 'users' and 'groups' are allowed.", + ) + entity_info = self.get_project_info()["access_" + entity_type] result = set() - for access_level in ["commit", "admin", "owner"]: - result.update(users_with_access[access_level]) + for access_level in access_levels: + result.update(entity_info[access_level]) return result + + def _get_user_accounts_with_access(self, access_levels: list[str]) -> set[str]: + """ + Get the users with the access levels given by the set. + """ + return self._get_entity_accounts_with_access(access_levels, "users") + + def _get_group_accounts_with_access(self, access_levels: list[str]) -> set[str]: + """ + Get the groups with the access levels given by list. + """ + return self._get_entity_accounts_with_access(access_levels, "groups") diff --git a/ogr/services/pagure/service.py b/ogr/services/pagure/service.py index 617310a1..408c8a43 100644 --- a/ogr/services/pagure/service.py +++ b/ogr/services/pagure/service.py @@ -17,6 +17,7 @@ from ogr.factory import use_for_service from ogr.parsing import parse_git_repo from ogr.services.base import BaseGitService, GitProject +from ogr.services.pagure.group import PagureGroup from ogr.services.pagure.project import PagureProject from ogr.services.pagure.user import PagureUser from ogr.utils import RequestResponse @@ -373,3 +374,10 @@ def list_projects( language: Optional[str] = None, ) -> list[GitProject]: raise OperationNotSupported + + def get_group(self, group_name: str) -> PagureGroup: + """ + Get a Pagure group by name. + """ + url = self.get_api_url("group", group_name) + return PagureGroup(group_name, self.call_api(url)) diff --git a/tests/integration/pagure/test_data/test_generic_commands/GenericCommands.test_get_users_with_given_access.yaml b/tests/integration/pagure/test_data/test_generic_commands/GenericCommands.test_get_users_with_given_access.yaml new file mode 100644 index 00000000..2a89db9c --- /dev/null +++ b/tests/integration/pagure/test_data/test_generic_commands/GenericCommands.test_get_users_with_given_access.yaml @@ -0,0 +1,312 @@ +_requre: + DataTypes: 1 + key_strategy: StorageKeysInspectSimple + version_storage_file: 3 +requests.sessions: + send: + GET: + https://pagure.io/api/0/group/packit-service: + - metadata: + latency: 0.40569329261779785 + module_call_list: + - unittest.case + - requre.record_and_replace + - tests.integration.pagure.test_generic_commands + - ogr.abstract + - ogr.services.pagure.project + - ogr.abstract + - ogr.services.pagure.project + - ogr.abstract + - ogr.services.pagure.service + - ogr.abstract + - ogr.services.pagure.service + - ogr.abstract + - ogr.services.pagure.service + - ogr.abstract + - ogr.services.pagure.service + - requests.sessions + - requre.objects + - requre.cassette + - requests.sessions + - send + output: + __store_indicator: 2 + _content: + creator: + default_email: flachman@redhat.com + emails: + - flachman@redhat.com + - lachmanfrantisek@gmail.com + full_url: https://pagure.io/user/lachmanfrantisek + fullname: "Franti\u0161ek Lachman" + name: lachmanfrantisek + url_path: user/lachmanfrantisek + date_created: '1570798102' + description: Packit related projects. + display_name: packit-service + full_url: https://pagure.io/group/packit-service + group_type: user + members: + - dhodovsk + - ttomecek + - lachmanfrantisek + - mfocko + - jscotka + - lbarczio + - jpopelka + name: packit-service + _next: null + elapsed: 0.2 + encoding: utf-8 + headers: + Connection: Keep-Alive + Content-Length: '703' + Content-Security-Policy: default-src 'self';script-src 'self' 'nonce-YqLDC0BS8d7iY8mKO7VtBbIne' + https://apps.fedoraproject.org; style-src 'self' 'nonce-YqLDC0BS8d7iY8mKO7VtBbIne'; + object-src 'none';base-uri 'self';img-src 'self' https:; + Content-Type: application/json + Date: Fri, 01 Nov 2019 13-36-03 GMT + Keep-Alive: timeout=5, max=97 + Referrer-Policy: same-origin + Server: Apache/2.4.37 (Red Hat Enterprise Linux) OpenSSL/1.1.1k mod_wsgi/4.6.4 + Python/3.6 + Set-Cookie: pagure=eyJfcGVybWFuZW50Ijp0cnVlLCJjc3JmX3Rva2VuIjoiZjcxZmY2MDFlZmIzMWNjNzAzYmU4Mjg1YmY0MWMxMzY5NDM5NmMxNyJ9.GJQc-Q.E9wLR9ZatZdALxSvMTXpMsuNNwQ; + Expires=Sun, 25-Feb-2024 16:25:29 GMT; Secure; HttpOnly; Path=/ + Strict-Transport-Security: max-age=31536000; includeSubDomains; preload + X-Content-Type-Options: nosniff + X-Frame-Options: ALLOW-FROM https://pagure.io/ + X-Xss-Protection: 1; mode=block + raw: !!binary "" + reason: OK + status_code: 200 + https://pagure.io/api/0/ogr-tests-group: + - metadata: + latency: 0.24735426902770996 + module_call_list: + - unittest.case + - requre.record_and_replace + - tests.integration.pagure.test_generic_commands + - ogr.abstract + - ogr.services.pagure.project + - ogr.abstract + - ogr.services.pagure.project + - ogr.abstract + - ogr.services.pagure.project + - ogr.abstract + - ogr.services.pagure.project + - ogr.abstract + - ogr.services.pagure.project + - ogr.abstract + - ogr.services.pagure.project + - ogr.abstract + - ogr.services.pagure.service + - ogr.abstract + - ogr.services.pagure.service + - ogr.abstract + - ogr.services.pagure.service + - requests.sessions + - requre.objects + - requre.cassette + - requests.sessions + - send + output: + __store_indicator: 2 + _content: + access_groups: + admin: + - packit-service + collaborator: [] + commit: [] + ticket: [] + access_users: + admin: [] + collaborator: [] + commit: [] + owner: + - lbarczio + ticket: [] + close_status: [] + custom_keys: [] + date_created: '1706191246' + date_modified: '1706191299' + description: 'Testing repository for python-ogr package. ' + full_url: https://pagure.io/ogr-tests-group + fullname: ogr-tests-group + id: 17549 + milestones: {} + name: ogr-tests-group + namespace: null + parent: null + priorities: {} + tags: [] + url_path: ogr-tests-group + user: + full_url: https://pagure.io/user/lbarczio + fullname: "Laura Barcziov\xC3\xA1" + name: lbarczio + url_path: user/lbarczio + _next: null + elapsed: 0.2 + encoding: utf-8 + headers: + Connection: Keep-Alive + Content-Length: '896' + Content-Security-Policy: default-src 'self';script-src 'self' 'nonce-YqLDC0BS8d7iY8mKO7VtBbIne' + https://apps.fedoraproject.org; style-src 'self' 'nonce-YqLDC0BS8d7iY8mKO7VtBbIne'; + object-src 'none';base-uri 'self';img-src 'self' https:; + Content-Type: application/json + Date: Fri, 01 Nov 2019 13-36-03 GMT + Keep-Alive: timeout=5, max=99 + Referrer-Policy: same-origin + Server: Apache/2.4.37 (Red Hat Enterprise Linux) OpenSSL/1.1.1k mod_wsgi/4.6.4 + Python/3.6 + Set-Cookie: pagure=eyJfcGVybWFuZW50Ijp0cnVlLCJjc3JmX3Rva2VuIjoiZjcxZmY2MDFlZmIzMWNjNzAzYmU4Mjg1YmY0MWMxMzY5NDM5NmMxNyJ9.GJQc-A.F6wyzEecvC4AtFoCFWyhIn08rdk; + Expires=Sun, 25-Feb-2024 16:25:28 GMT; Secure; HttpOnly; Path=/ + Strict-Transport-Security: max-age=31536000; includeSubDomains; preload + X-Content-Type-Options: nosniff + X-Frame-Options: ALLOW-FROM https://pagure.io/ + X-Xss-Protection: 1; mode=block + raw: !!binary "" + reason: OK + status_code: 200 + - metadata: + latency: 0.2754337787628174 + module_call_list: + - unittest.case + - requre.record_and_replace + - tests.integration.pagure.test_generic_commands + - ogr.abstract + - ogr.services.pagure.project + - ogr.abstract + - ogr.services.pagure.project + - ogr.abstract + - ogr.services.pagure.project + - ogr.abstract + - ogr.services.pagure.project + - ogr.abstract + - ogr.services.pagure.project + - ogr.abstract + - ogr.services.pagure.project + - ogr.abstract + - ogr.services.pagure.service + - ogr.abstract + - ogr.services.pagure.service + - ogr.abstract + - ogr.services.pagure.service + - requests.sessions + - requre.objects + - requre.cassette + - requests.sessions + - send + output: + __store_indicator: 2 + _content: + access_groups: + admin: + - packit-service + collaborator: [] + commit: [] + ticket: [] + access_users: + admin: [] + collaborator: [] + commit: [] + owner: + - lbarczio + ticket: [] + close_status: [] + custom_keys: [] + date_created: '1706191246' + date_modified: '1706191299' + description: 'Testing repository for python-ogr package. ' + full_url: https://pagure.io/ogr-tests-group + fullname: ogr-tests-group + id: 17549 + milestones: {} + name: ogr-tests-group + namespace: null + parent: null + priorities: {} + tags: [] + url_path: ogr-tests-group + user: + full_url: https://pagure.io/user/lbarczio + fullname: "Laura Barcziov\xC3\xA1" + name: lbarczio + url_path: user/lbarczio + _next: null + elapsed: 0.2 + encoding: utf-8 + headers: + Connection: Keep-Alive + Content-Length: '896' + Content-Security-Policy: default-src 'self';script-src 'self' 'nonce-YqLDC0BS8d7iY8mKO7VtBbIne' + https://apps.fedoraproject.org; style-src 'self' 'nonce-YqLDC0BS8d7iY8mKO7VtBbIne'; + object-src 'none';base-uri 'self';img-src 'self' https:; + Content-Type: application/json + Date: Fri, 01 Nov 2019 13-36-03 GMT + Keep-Alive: timeout=5, max=98 + Referrer-Policy: same-origin + Server: Apache/2.4.37 (Red Hat Enterprise Linux) OpenSSL/1.1.1k mod_wsgi/4.6.4 + Python/3.6 + Set-Cookie: pagure=eyJfcGVybWFuZW50Ijp0cnVlLCJjc3JmX3Rva2VuIjoiZjcxZmY2MDFlZmIzMWNjNzAzYmU4Mjg1YmY0MWMxMzY5NDM5NmMxNyJ9.GJQc-Q.E9wLR9ZatZdALxSvMTXpMsuNNwQ; + Expires=Sun, 25-Feb-2024 16:25:29 GMT; Secure; HttpOnly; Path=/ + Strict-Transport-Security: max-age=31536000; includeSubDomains; preload + X-Content-Type-Options: nosniff + X-Frame-Options: ALLOW-FROM https://pagure.io/ + X-Xss-Protection: 1; mode=block + raw: !!binary "" + reason: OK + status_code: 200 + POST: + https://pagure.io/api/0/-/whoami: + - metadata: + latency: 0.7423610687255859 + module_call_list: + - unittest.case + - requre.record_and_replace + - tests.integration.pagure.test_generic_commands + - ogr.abstract + - ogr.services.pagure.service + - ogr.abstract + - ogr.services.pagure.user + - ogr.abstract + - ogr.services.pagure.service + - ogr.abstract + - ogr.services.pagure.service + - ogr.abstract + - ogr.services.pagure.service + - requests.sessions + - requre.objects + - requre.cassette + - requests.sessions + - send + output: + __store_indicator: 2 + _content: + username: lbarczio + _next: null + elapsed: 0.2 + encoding: utf-8 + headers: + Connection: Upgrade, Keep-Alive + Content-Length: '29' + Content-Security-Policy: default-src 'self';script-src 'self' 'nonce-YqLDC0BS8d7iY8mKO7VtBbIne' + https://apps.fedoraproject.org; style-src 'self' 'nonce-YqLDC0BS8d7iY8mKO7VtBbIne'; + object-src 'none';base-uri 'self';img-src 'self' https:; + Content-Type: application/json + Date: Fri, 01 Nov 2019 13-36-03 GMT + Keep-Alive: timeout=5, max=100 + Referrer-Policy: same-origin + Server: Apache/2.4.37 (Red Hat Enterprise Linux) OpenSSL/1.1.1k mod_wsgi/4.6.4 + Python/3.6 + Set-Cookie: pagure=eyJfcGVybWFuZW50Ijp0cnVlLCJjc3JmX3Rva2VuIjoiZjcxZmY2MDFlZmIzMWNjNzAzYmU4Mjg1YmY0MWMxMzY5NDM5NmMxNyJ9.GJQc-A.F6wyzEecvC4AtFoCFWyhIn08rdk; + Expires=Sun, 25-Feb-2024 16:25:28 GMT; Secure; HttpOnly; Path=/ + Strict-Transport-Security: max-age=31536000; includeSubDomains; preload + Upgrade: h2,h2c + X-Content-Type-Options: nosniff + X-Frame-Options: ALLOW-FROM https://pagure.io/ + X-Xss-Protection: 1; mode=block + raw: !!binary "" + reason: OK + status_code: 200 diff --git a/tests/integration/pagure/test_data/test_generic_commands/GenericCommands.test_pr_permissions.yaml b/tests/integration/pagure/test_data/test_generic_commands/GenericCommands.test_pr_permissions.yaml index d68bc651..946460bb 100644 --- a/tests/integration/pagure/test_data/test_generic_commands/GenericCommands.test_pr_permissions.yaml +++ b/tests/integration/pagure/test_data/test_generic_commands/GenericCommands.test_pr_permissions.yaml @@ -5,9 +5,81 @@ _requre: requests.sessions: send: GET: + https://pagure.io/api/0/group/packit-service: + - metadata: + latency: 0.30262112617492676 + module_call_list: + - unittest.case + - requre.record_and_replace + - tests.integration.pagure.test_generic_commands + - ogr.abstract + - ogr.services.pagure.project + - ogr.abstract + - ogr.services.pagure.service + - ogr.abstract + - ogr.services.pagure.service + - ogr.abstract + - ogr.services.pagure.service + - ogr.abstract + - ogr.services.pagure.service + - requests.sessions + - requre.objects + - requre.cassette + - requests.sessions + - send + output: + __store_indicator: 2 + _content: + creator: + default_email: flachman@redhat.com + emails: + - flachman@redhat.com + - lachmanfrantisek@gmail.com + full_url: https://pagure.io/user/lachmanfrantisek + fullname: "Franti\u0161ek Lachman" + name: lachmanfrantisek + url_path: user/lachmanfrantisek + date_created: '1570798102' + description: Packit related projects. + display_name: packit-service + full_url: https://pagure.io/group/packit-service + group_type: user + members: + - dhodovsk + - ttomecek + - lachmanfrantisek + - mfocko + - jscotka + - lbarczio + - jpopelka + name: packit-service + _next: null + elapsed: 0.2 + encoding: utf-8 + headers: + Connection: Keep-Alive + Content-Length: '703' + Content-Security-Policy: default-src 'self';script-src 'self' 'nonce-YqLDC0BS8d7iY8mKO7VtBbIne' + https://apps.fedoraproject.org; style-src 'self' 'nonce-YqLDC0BS8d7iY8mKO7VtBbIne'; + object-src 'none';base-uri 'self';img-src 'self' https:; + Content-Type: application/json + Date: Fri, 01 Nov 2019 13-36-03 GMT + Keep-Alive: timeout=5, max=92 + Referrer-Policy: same-origin + Server: Apache/2.4.37 (Red Hat Enterprise Linux) OpenSSL/1.1.1k mod_wsgi/4.6.4 + Python/3.6 + Set-Cookie: pagure=eyJfcGVybWFuZW50Ijp0cnVlLCJjc3JmX3Rva2VuIjoiZTg5MmRmNjkwOGRmY2UzOTA1Mjk5ZTExMDMyZmM1NWIyYzMxODUyYyJ9.GJQc_Q.uECZWAOBRmrquvgdxDlfYFgpQbA; + Expires=Sun, 25-Feb-2024 16:25:33 GMT; Secure; HttpOnly; Path=/ + Strict-Transport-Security: max-age=31536000; includeSubDomains; preload + X-Content-Type-Options: nosniff + X-Frame-Options: ALLOW-FROM https://pagure.io/ + X-Xss-Protection: 1; mode=block + raw: !!binary "" + reason: OK + status_code: 200 https://pagure.io/api/0/ogr-tests: - metadata: - latency: 0.218308687210083 + latency: 0.30403828620910645 module_call_list: - unittest.case - requre.record_and_replace @@ -71,23 +143,22 @@ requests.sessions: name: lachmanfrantisek url_path: user/lachmanfrantisek _next: null - elapsed: 0.217262 + elapsed: 0.2 encoding: utf-8 headers: Connection: Keep-Alive Content-Length: '982' - Content-Security-Policy: default-src 'self';script-src 'self' 'nonce-1he9XDYl69LyT7PlBpVJqGayj'; - style-src 'self' 'nonce-1he9XDYl69LyT7PlBpVJqGayj'; object-src 'none';base-uri - 'self';img-src 'self' https:;connect-src 'self' https://pagure.io:8088;frame-src - https://docs.pagure.org;frame-ancestors https://pagure.io; + Content-Security-Policy: default-src 'self';script-src 'self' 'nonce-YqLDC0BS8d7iY8mKO7VtBbIne' + https://apps.fedoraproject.org; style-src 'self' 'nonce-YqLDC0BS8d7iY8mKO7VtBbIne'; + object-src 'none';base-uri 'self';img-src 'self' https:; Content-Type: application/json - Date: Mon, 09 Oct 2023 17:38:14 GMT + Date: Fri, 01 Nov 2019 13-36-03 GMT Keep-Alive: timeout=5, max=99 Referrer-Policy: same-origin Server: Apache/2.4.37 (Red Hat Enterprise Linux) OpenSSL/1.1.1k mod_wsgi/4.6.4 Python/3.6 - Set-Cookie: pagure=eyJfcGVybWFuZW50Ijp0cnVlLCJjc3JmX3Rva2VuIjoiZWY5NWQ5NzRmNmFjYmFkYzM0OTYzMDNjYjViZjRmOTE1ZTc3ZjVjMCJ9.GAXMBg.olzyd-GVUepDs3wzWzGGPXF_IGg; - Expires=Thu, 09-Nov-2023 17:38:14 GMT; Secure; HttpOnly; Path=/ + Set-Cookie: pagure=eyJfcGVybWFuZW50Ijp0cnVlLCJjc3JmX3Rva2VuIjoiZTg5MmRmNjkwOGRmY2UzOTA1Mjk5ZTExMDMyZmM1NWIyYzMxODUyYyJ9.GJQc-g.gXqeMVM8ylWgrORWXDwZVeTHASQ; + Expires=Sun, 25-Feb-2024 16:25:30 GMT; Secure; HttpOnly; Path=/ Strict-Transport-Security: max-age=31536000; includeSubDomains; preload X-Content-Type-Options: nosniff X-Frame-Options: ALLOW-FROM https://pagure.io/ @@ -96,7 +167,7 @@ requests.sessions: reason: OK status_code: 200 - metadata: - latency: 0.22804784774780273 + latency: 0.4524543285369873 module_call_list: - unittest.case - requre.record_and_replace @@ -162,23 +233,22 @@ requests.sessions: name: lachmanfrantisek url_path: user/lachmanfrantisek _next: null - elapsed: 0.22703 + elapsed: 0.2 encoding: utf-8 headers: Connection: Keep-Alive Content-Length: '982' - Content-Security-Policy: default-src 'self';script-src 'self' 'nonce-5LTu7bhmW4dXgC8SQ8EgFknre'; - style-src 'self' 'nonce-5LTu7bhmW4dXgC8SQ8EgFknre'; object-src 'none';base-uri - 'self';img-src 'self' https:;connect-src 'self' https://pagure.io:8088;frame-src - https://docs.pagure.org;frame-ancestors https://pagure.io; + Content-Security-Policy: default-src 'self';script-src 'self' 'nonce-YqLDC0BS8d7iY8mKO7VtBbIne' + https://apps.fedoraproject.org; style-src 'self' 'nonce-YqLDC0BS8d7iY8mKO7VtBbIne'; + object-src 'none';base-uri 'self';img-src 'self' https:; Content-Type: application/json - Date: Mon, 09 Oct 2023 17:38:14 GMT + Date: Fri, 01 Nov 2019 13-36-03 GMT Keep-Alive: timeout=5, max=98 Referrer-Policy: same-origin Server: Apache/2.4.37 (Red Hat Enterprise Linux) OpenSSL/1.1.1k mod_wsgi/4.6.4 Python/3.6 - Set-Cookie: pagure=eyJfcGVybWFuZW50Ijp0cnVlLCJjc3JmX3Rva2VuIjoiZWY5NWQ5NzRmNmFjYmFkYzM0OTYzMDNjYjViZjRmOTE1ZTc3ZjVjMCJ9.GAXMBg.olzyd-GVUepDs3wzWzGGPXF_IGg; - Expires=Thu, 09-Nov-2023 17:38:14 GMT; Secure; HttpOnly; Path=/ + Set-Cookie: pagure=eyJfcGVybWFuZW50Ijp0cnVlLCJjc3JmX3Rva2VuIjoiZTg5MmRmNjkwOGRmY2UzOTA1Mjk5ZTExMDMyZmM1NWIyYzMxODUyYyJ9.GJQc-w.lOXY74k6_tZ5IRiZkSaTM_x8moU; + Expires=Sun, 25-Feb-2024 16:25:31 GMT; Secure; HttpOnly; Path=/ Strict-Transport-Security: max-age=31536000; includeSubDomains; preload X-Content-Type-Options: nosniff X-Frame-Options: ALLOW-FROM https://pagure.io/ @@ -186,9 +256,8 @@ requests.sessions: raw: !!binary "" reason: OK status_code: 200 - https://pagure.io/api/0/playground-nforro: - metadata: - latency: 0.22342777252197266 + latency: 0.24950551986694336 module_call_list: - unittest.case - requre.record_and_replace @@ -200,6 +269,8 @@ requests.sessions: - ogr.abstract - ogr.services.pagure.project - ogr.abstract + - ogr.services.pagure.project + - ogr.abstract - ogr.services.pagure.service - ogr.abstract - ogr.services.pagure.service @@ -216,54 +287,142 @@ requests.sessions: access_groups: admin: [] collaborator: [] - commit: - - packit-test-group + commit: [] + ticket: [] + access_users: + admin: + - jpopelka + - jscotka + - lbarczio + - mfocko + - nforro + - nikromen + collaborator: [] + commit: [] + owner: + - lachmanfrantisek + ticket: [] + close_status: [] + custom_keys: [] + date_created: '1570568389' + date_modified: '1696856843' + description: Testing repository for python-ogr package. + full_url: https://pagure.io/ogr-tests + fullname: ogr-tests + id: 6826 + milestones: {} + name: ogr-tests + namespace: null + parent: null + priorities: {} + tags: [] + url_path: ogr-tests + user: + full_url: https://pagure.io/user/lachmanfrantisek + fullname: "Franti\u0161ek Lachman" + name: lachmanfrantisek + url_path: user/lachmanfrantisek + _next: null + elapsed: 0.2 + encoding: utf-8 + headers: + Connection: Keep-Alive + Content-Length: '982' + Content-Security-Policy: default-src 'self';script-src 'self' 'nonce-YqLDC0BS8d7iY8mKO7VtBbIne' + https://apps.fedoraproject.org; style-src 'self' 'nonce-YqLDC0BS8d7iY8mKO7VtBbIne'; + object-src 'none';base-uri 'self';img-src 'self' https:; + Content-Type: application/json + Date: Fri, 01 Nov 2019 13-36-03 GMT + Keep-Alive: timeout=5, max=97 + Referrer-Policy: same-origin + Server: Apache/2.4.37 (Red Hat Enterprise Linux) OpenSSL/1.1.1k mod_wsgi/4.6.4 + Python/3.6 + Set-Cookie: pagure=eyJfcGVybWFuZW50Ijp0cnVlLCJjc3JmX3Rva2VuIjoiZTg5MmRmNjkwOGRmY2UzOTA1Mjk5ZTExMDMyZmM1NWIyYzMxODUyYyJ9.GJQc-w.lOXY74k6_tZ5IRiZkSaTM_x8moU; + Expires=Sun, 25-Feb-2024 16:25:31 GMT; Secure; HttpOnly; Path=/ + Strict-Transport-Security: max-age=31536000; includeSubDomains; preload + X-Content-Type-Options: nosniff + X-Frame-Options: ALLOW-FROM https://pagure.io/ + X-Xss-Protection: 1; mode=block + raw: !!binary "" + reason: OK + status_code: 200 + https://pagure.io/api/0/ogr-tests-group: + - metadata: + latency: 0.4055352210998535 + module_call_list: + - unittest.case + - requre.record_and_replace + - tests.integration.pagure.test_generic_commands + - ogr.abstract + - ogr.services.pagure.project + - ogr.abstract + - ogr.services.pagure.project + - ogr.abstract + - ogr.services.pagure.project + - ogr.abstract + - ogr.services.pagure.service + - ogr.abstract + - ogr.services.pagure.service + - ogr.abstract + - ogr.services.pagure.service + - requests.sessions + - requre.objects + - requre.cassette + - requests.sessions + - send + output: + __store_indicator: 2 + _content: + access_groups: + admin: + - packit-service + collaborator: [] + commit: [] ticket: [] access_users: admin: [] collaborator: [] commit: [] owner: - - nforro + - lbarczio ticket: [] close_status: [] custom_keys: [] - date_created: '1696871156' - date_modified: '1696872541' - description: playground-nforro - full_url: https://pagure.io/playground-nforro - fullname: playground-nforro - id: 17033 + date_created: '1706191246' + date_modified: '1706191299' + description: 'Testing repository for python-ogr package. ' + full_url: https://pagure.io/ogr-tests-group + fullname: ogr-tests-group + id: 17549 milestones: {} - name: playground-nforro + name: ogr-tests-group namespace: null parent: null priorities: {} tags: [] - url_path: playground-nforro + url_path: ogr-tests-group user: - full_url: https://pagure.io/user/nforro - fullname: "Nikola Forr\xF3" - name: nforro - url_path: user/nforro + full_url: https://pagure.io/user/lbarczio + fullname: "Laura Barcziov\xC3\xA1" + name: lbarczio + url_path: user/lbarczio _next: null - elapsed: 0.222285 + elapsed: 0.2 encoding: utf-8 headers: Connection: Keep-Alive - Content-Length: '864' - Content-Security-Policy: default-src 'self';script-src 'self' 'nonce-FZ3ZrxItAhIgTzjAwuaKrG3ee'; - style-src 'self' 'nonce-FZ3ZrxItAhIgTzjAwuaKrG3ee'; object-src 'none';base-uri - 'self';img-src 'self' https:;connect-src 'self' https://pagure.io:8088;frame-src - https://docs.pagure.org;frame-ancestors https://pagure.io; + Content-Length: '896' + Content-Security-Policy: default-src 'self';script-src 'self' 'nonce-YqLDC0BS8d7iY8mKO7VtBbIne' + https://apps.fedoraproject.org; style-src 'self' 'nonce-YqLDC0BS8d7iY8mKO7VtBbIne'; + object-src 'none';base-uri 'self';img-src 'self' https:; Content-Type: application/json - Date: Mon, 09 Oct 2023 17:38:15 GMT + Date: Fri, 01 Nov 2019 13-36-03 GMT Keep-Alive: timeout=5, max=95 Referrer-Policy: same-origin Server: Apache/2.4.37 (Red Hat Enterprise Linux) OpenSSL/1.1.1k mod_wsgi/4.6.4 Python/3.6 - Set-Cookie: pagure=eyJfcGVybWFuZW50Ijp0cnVlLCJjc3JmX3Rva2VuIjoiZWY5NWQ5NzRmNmFjYmFkYzM0OTYzMDNjYjViZjRmOTE1ZTc3ZjVjMCJ9.GAXMBw.zdcrtg0pkCth37ICGbcFX6pXPgU; - Expires=Thu, 09-Nov-2023 17:38:15 GMT; Secure; HttpOnly; Path=/ + Set-Cookie: pagure=eyJfcGVybWFuZW50Ijp0cnVlLCJjc3JmX3Rva2VuIjoiZTg5MmRmNjkwOGRmY2UzOTA1Mjk5ZTExMDMyZmM1NWIyYzMxODUyYyJ9.GJQc_A.f5CenZdBFM-vcOniWnyRnI_gu7c; + Expires=Sun, 25-Feb-2024 16:25:32 GMT; Secure; HttpOnly; Path=/ Strict-Transport-Security: max-age=31536000; includeSubDomains; preload X-Content-Type-Options: nosniff X-Frame-Options: ALLOW-FROM https://pagure.io/ @@ -271,19 +430,105 @@ requests.sessions: raw: !!binary "" reason: OK status_code: 200 - POST: - https://pagure.io/api/0/-/whoami: - metadata: - latency: 0.8489458560943604 + latency: 0.30228567123413086 module_call_list: - unittest.case - requre.record_and_replace - tests.integration.pagure.test_generic_commands - - tests.integration.pagure.base + - ogr.abstract + - ogr.services.pagure.project + - ogr.abstract + - ogr.services.pagure.project + - ogr.abstract + - ogr.services.pagure.project + - ogr.abstract + - ogr.services.pagure.project - ogr.abstract - ogr.services.pagure.service - ogr.abstract - - ogr.services.pagure.user + - ogr.services.pagure.service + - ogr.abstract + - ogr.services.pagure.service + - requests.sessions + - requre.objects + - requre.cassette + - requests.sessions + - send + output: + __store_indicator: 2 + _content: + access_groups: + admin: + - packit-service + collaborator: [] + commit: [] + ticket: [] + access_users: + admin: [] + collaborator: [] + commit: [] + owner: + - lbarczio + ticket: [] + close_status: [] + custom_keys: [] + date_created: '1706191246' + date_modified: '1706191299' + description: 'Testing repository for python-ogr package. ' + full_url: https://pagure.io/ogr-tests-group + fullname: ogr-tests-group + id: 17549 + milestones: {} + name: ogr-tests-group + namespace: null + parent: null + priorities: {} + tags: [] + url_path: ogr-tests-group + user: + full_url: https://pagure.io/user/lbarczio + fullname: "Laura Barcziov\xC3\xA1" + name: lbarczio + url_path: user/lbarczio + _next: null + elapsed: 0.2 + encoding: utf-8 + headers: + Connection: Keep-Alive + Content-Length: '896' + Content-Security-Policy: default-src 'self';script-src 'self' 'nonce-YqLDC0BS8d7iY8mKO7VtBbIne' + https://apps.fedoraproject.org; style-src 'self' 'nonce-YqLDC0BS8d7iY8mKO7VtBbIne'; + object-src 'none';base-uri 'self';img-src 'self' https:; + Content-Type: application/json + Date: Fri, 01 Nov 2019 13-36-03 GMT + Keep-Alive: timeout=5, max=94 + Referrer-Policy: same-origin + Server: Apache/2.4.37 (Red Hat Enterprise Linux) OpenSSL/1.1.1k mod_wsgi/4.6.4 + Python/3.6 + Set-Cookie: pagure=eyJfcGVybWFuZW50Ijp0cnVlLCJjc3JmX3Rva2VuIjoiZTg5MmRmNjkwOGRmY2UzOTA1Mjk5ZTExMDMyZmM1NWIyYzMxODUyYyJ9.GJQc_A.f5CenZdBFM-vcOniWnyRnI_gu7c; + Expires=Sun, 25-Feb-2024 16:25:32 GMT; Secure; HttpOnly; Path=/ + Strict-Transport-Security: max-age=31536000; includeSubDomains; preload + X-Content-Type-Options: nosniff + X-Frame-Options: ALLOW-FROM https://pagure.io/ + X-Xss-Protection: 1; mode=block + raw: !!binary "" + reason: OK + status_code: 200 + - metadata: + latency: 0.30028510093688965 + module_call_list: + - unittest.case + - requre.record_and_replace + - tests.integration.pagure.test_generic_commands + - ogr.abstract + - ogr.services.pagure.project + - ogr.abstract + - ogr.services.pagure.project + - ogr.abstract + - ogr.services.pagure.project + - ogr.abstract + - ogr.services.pagure.project - ogr.abstract - ogr.services.pagure.service - ogr.abstract @@ -298,39 +543,74 @@ requests.sessions: output: __store_indicator: 2 _content: - username: nforro + access_groups: + admin: + - packit-service + collaborator: [] + commit: [] + ticket: [] + access_users: + admin: [] + collaborator: [] + commit: [] + owner: + - lbarczio + ticket: [] + close_status: [] + custom_keys: [] + date_created: '1706191246' + date_modified: '1706191299' + description: 'Testing repository for python-ogr package. ' + full_url: https://pagure.io/ogr-tests-group + fullname: ogr-tests-group + id: 17549 + milestones: {} + name: ogr-tests-group + namespace: null + parent: null + priorities: {} + tags: [] + url_path: ogr-tests-group + user: + full_url: https://pagure.io/user/lbarczio + fullname: "Laura Barcziov\xC3\xA1" + name: lbarczio + url_path: user/lbarczio _next: null - elapsed: 0.848332 + elapsed: 0.2 encoding: utf-8 headers: - Connection: Upgrade, Keep-Alive - Content-Length: '27' - Content-Security-Policy: default-src 'self';script-src 'self' 'nonce-pJOYEfHN6G35MiWwfRsVCxaFY'; - style-src 'self' 'nonce-pJOYEfHN6G35MiWwfRsVCxaFY'; object-src 'none';base-uri - 'self';img-src 'self' https:;connect-src 'self' https://pagure.io:8088;frame-src - https://docs.pagure.org;frame-ancestors https://pagure.io; + Connection: Keep-Alive + Content-Length: '896' + Content-Security-Policy: default-src 'self';script-src 'self' 'nonce-YqLDC0BS8d7iY8mKO7VtBbIne' + https://apps.fedoraproject.org; style-src 'self' 'nonce-YqLDC0BS8d7iY8mKO7VtBbIne'; + object-src 'none';base-uri 'self';img-src 'self' https:; Content-Type: application/json - Date: Mon, 09 Oct 2023 17:38:13 GMT - Keep-Alive: timeout=5, max=100 + Date: Fri, 01 Nov 2019 13-36-03 GMT + Keep-Alive: timeout=5, max=93 Referrer-Policy: same-origin Server: Apache/2.4.37 (Red Hat Enterprise Linux) OpenSSL/1.1.1k mod_wsgi/4.6.4 Python/3.6 - Set-Cookie: pagure=eyJfcGVybWFuZW50Ijp0cnVlLCJjc3JmX3Rva2VuIjoiZWY5NWQ5NzRmNmFjYmFkYzM0OTYzMDNjYjViZjRmOTE1ZTc3ZjVjMCJ9.GAXMBQ.fWunzSGXYMncsRX7kUwTqYQBl0k; - Expires=Thu, 09-Nov-2023 17:38:13 GMT; Secure; HttpOnly; Path=/ + Set-Cookie: pagure=eyJfcGVybWFuZW50Ijp0cnVlLCJjc3JmX3Rva2VuIjoiZTg5MmRmNjkwOGRmY2UzOTA1Mjk5ZTExMDMyZmM1NWIyYzMxODUyYyJ9.GJQc_A.f5CenZdBFM-vcOniWnyRnI_gu7c; + Expires=Sun, 25-Feb-2024 16:25:32 GMT; Secure; HttpOnly; Path=/ Strict-Transport-Security: max-age=31536000; includeSubDomains; preload - Upgrade: h2,h2c X-Content-Type-Options: nosniff X-Frame-Options: ALLOW-FROM https://pagure.io/ X-Xss-Protection: 1; mode=block raw: !!binary "" reason: OK status_code: 200 + POST: + https://pagure.io/api/0/-/whoami: - metadata: - latency: 0.2468886375427246 + latency: 0.5451598167419434 module_call_list: - unittest.case - requre.record_and_replace - tests.integration.pagure.test_generic_commands + - tests.integration.pagure.base + - ogr.abstract + - ogr.services.pagure.service - ogr.abstract - ogr.services.pagure.user - ogr.abstract @@ -347,26 +627,26 @@ requests.sessions: output: __store_indicator: 2 _content: - username: nforro + username: lbarczio _next: null - elapsed: 0.245788 + elapsed: 0.2 encoding: utf-8 headers: - Connection: Keep-Alive - Content-Length: '27' - Content-Security-Policy: default-src 'self';script-src 'self' 'nonce-pzSCmhdnC9Gd640J4yXfqrVkY'; - style-src 'self' 'nonce-pzSCmhdnC9Gd640J4yXfqrVkY'; object-src 'none';base-uri - 'self';img-src 'self' https:;connect-src 'self' https://pagure.io:8088;frame-src - https://docs.pagure.org;frame-ancestors https://pagure.io; + Connection: Upgrade, Keep-Alive + Content-Length: '29' + Content-Security-Policy: default-src 'self';script-src 'self' 'nonce-YqLDC0BS8d7iY8mKO7VtBbIne' + https://apps.fedoraproject.org; style-src 'self' 'nonce-YqLDC0BS8d7iY8mKO7VtBbIne'; + object-src 'none';base-uri 'self';img-src 'self' https:; Content-Type: application/json - Date: Mon, 09 Oct 2023 17:38:14 GMT - Keep-Alive: timeout=5, max=97 + Date: Fri, 01 Nov 2019 13-36-03 GMT + Keep-Alive: timeout=5, max=100 Referrer-Policy: same-origin Server: Apache/2.4.37 (Red Hat Enterprise Linux) OpenSSL/1.1.1k mod_wsgi/4.6.4 Python/3.6 - Set-Cookie: pagure=eyJfcGVybWFuZW50Ijp0cnVlLCJjc3JmX3Rva2VuIjoiZWY5NWQ5NzRmNmFjYmFkYzM0OTYzMDNjYjViZjRmOTE1ZTc3ZjVjMCJ9.GAXMBg.olzyd-GVUepDs3wzWzGGPXF_IGg; - Expires=Thu, 09-Nov-2023 17:38:14 GMT; Secure; HttpOnly; Path=/ + Set-Cookie: pagure=eyJfcGVybWFuZW50Ijp0cnVlLCJjc3JmX3Rva2VuIjoiZTg5MmRmNjkwOGRmY2UzOTA1Mjk5ZTExMDMyZmM1NWIyYzMxODUyYyJ9.GJQc-g.gXqeMVM8ylWgrORWXDwZVeTHASQ; + Expires=Sun, 25-Feb-2024 16:25:30 GMT; Secure; HttpOnly; Path=/ Strict-Transport-Security: max-age=31536000; includeSubDomains; preload + Upgrade: h2,h2c X-Content-Type-Options: nosniff X-Frame-Options: ALLOW-FROM https://pagure.io/ X-Xss-Protection: 1; mode=block @@ -374,7 +654,7 @@ requests.sessions: reason: OK status_code: 200 - metadata: - latency: 0.2515885829925537 + latency: 0.45835304260253906 module_call_list: - unittest.case - requre.record_and_replace @@ -397,25 +677,24 @@ requests.sessions: output: __store_indicator: 2 _content: - username: nforro + username: lbarczio _next: null - elapsed: 0.250437 + elapsed: 0.2 encoding: utf-8 headers: Connection: Keep-Alive - Content-Length: '27' - Content-Security-Policy: default-src 'self';script-src 'self' 'nonce-wdFguAEX0F5xXBuuemGaVSrUz'; - style-src 'self' 'nonce-wdFguAEX0F5xXBuuemGaVSrUz'; object-src 'none';base-uri - 'self';img-src 'self' https:;connect-src 'self' https://pagure.io:8088;frame-src - https://docs.pagure.org;frame-ancestors https://pagure.io; + Content-Length: '29' + Content-Security-Policy: default-src 'self';script-src 'self' 'nonce-YqLDC0BS8d7iY8mKO7VtBbIne' + https://apps.fedoraproject.org; style-src 'self' 'nonce-YqLDC0BS8d7iY8mKO7VtBbIne'; + object-src 'none';base-uri 'self';img-src 'self' https:; Content-Type: application/json - Date: Mon, 09 Oct 2023 17:38:14 GMT + Date: Fri, 01 Nov 2019 13-36-03 GMT Keep-Alive: timeout=5, max=96 Referrer-Policy: same-origin Server: Apache/2.4.37 (Red Hat Enterprise Linux) OpenSSL/1.1.1k mod_wsgi/4.6.4 Python/3.6 - Set-Cookie: pagure=eyJfcGVybWFuZW50Ijp0cnVlLCJjc3JmX3Rva2VuIjoiZWY5NWQ5NzRmNmFjYmFkYzM0OTYzMDNjYjViZjRmOTE1ZTc3ZjVjMCJ9.GAXMBg.olzyd-GVUepDs3wzWzGGPXF_IGg; - Expires=Thu, 09-Nov-2023 17:38:14 GMT; Secure; HttpOnly; Path=/ + Set-Cookie: pagure=eyJfcGVybWFuZW50Ijp0cnVlLCJjc3JmX3Rva2VuIjoiZTg5MmRmNjkwOGRmY2UzOTA1Mjk5ZTExMDMyZmM1NWIyYzMxODUyYyJ9.GJQc-w.lOXY74k6_tZ5IRiZkSaTM_x8moU; + Expires=Sun, 25-Feb-2024 16:25:31 GMT; Secure; HttpOnly; Path=/ Strict-Transport-Security: max-age=31536000; includeSubDomains; preload X-Content-Type-Options: nosniff X-Frame-Options: ALLOW-FROM https://pagure.io/ diff --git a/tests/integration/pagure/test_data/test_generic_commands/GenericCommands.test_write_access_to_repo.yaml b/tests/integration/pagure/test_data/test_generic_commands/GenericCommands.test_write_access_to_repo.yaml index 9eedd7df..558c757e 100644 --- a/tests/integration/pagure/test_data/test_generic_commands/GenericCommands.test_write_access_to_repo.yaml +++ b/tests/integration/pagure/test_data/test_generic_commands/GenericCommands.test_write_access_to_repo.yaml @@ -7,7 +7,7 @@ requests.sessions: GET: https://pagure.io/api/0/ogr-tests: - metadata: - latency: 0.20897722244262695 + latency: 0.30188798904418945 module_call_list: - unittest.case - requre.record_and_replace @@ -19,6 +19,12 @@ requests.sessions: - ogr.abstract - ogr.services.pagure.project - ogr.abstract + - ogr.services.pagure.project + - ogr.abstract + - ogr.services.pagure.project + - ogr.abstract + - ogr.services.pagure.project + - ogr.abstract - ogr.services.pagure.service - ogr.abstract - ogr.services.pagure.service @@ -43,6 +49,7 @@ requests.sessions: - jscotka - lbarczio - mfocko + - nforro - nikromen collaborator: [] commit: [] @@ -52,7 +59,7 @@ requests.sessions: close_status: [] custom_keys: [] date_created: '1570568389' - date_modified: '1651242136' + date_modified: '1696856843' description: Testing repository for python-ogr package. full_url: https://pagure.io/ogr-tests fullname: ogr-tests @@ -70,23 +77,22 @@ requests.sessions: name: lachmanfrantisek url_path: user/lachmanfrantisek _next: null - elapsed: 0.208345 + elapsed: 0.2 encoding: utf-8 headers: Connection: Keep-Alive - Content-Length: '965' - Content-Security-Policy: default-src 'self';script-src 'self' 'nonce-5bV9Xcxq53Ema0POCUY8mBf7e'; - style-src 'self' 'nonce-5bV9Xcxq53Ema0POCUY8mBf7e'; object-src 'none';base-uri - 'self';img-src 'self' https:;connect-src 'self' https://pagure.io:8088;frame-src - https://docs.pagure.org;frame-ancestors https://pagure.io; + Content-Length: '982' + Content-Security-Policy: default-src 'self';script-src 'self' 'nonce-YqLDC0BS8d7iY8mKO7VtBbIne' + https://apps.fedoraproject.org; style-src 'self' 'nonce-YqLDC0BS8d7iY8mKO7VtBbIne'; + object-src 'none';base-uri 'self';img-src 'self' https:; Content-Type: application/json - Date: Wed, 14 Sep 2022 13:38:18 GMT + Date: Fri, 01 Nov 2019 13-36-03 GMT Keep-Alive: timeout=5, max=99 Referrer-Policy: same-origin Server: Apache/2.4.37 (Red Hat Enterprise Linux) OpenSSL/1.1.1k mod_wsgi/4.6.4 Python/3.6 - Set-Cookie: pagure=eyJfcGVybWFuZW50Ijp0cnVlLCJjc3JmX3Rva2VuIjoiMzcxOTkwNDczMWJjNjNkZDgzZGRjMmRhZWI3YmQwZjlhZDU2NzQxMyJ9.FgNqyg.tRnRwzBRDH4ly9uv4AcO5Gd3RJM; - Expires=Sat, 15-Oct-2022 13:38:18 GMT; Secure; HttpOnly; Path=/ + Set-Cookie: pagure=eyJfcGVybWFuZW50Ijp0cnVlLCJjc3JmX3Rva2VuIjoiYjFjNGJjMjBjNzQwM2ZlMWE1OWU4MjIxYmI0OGQ2YzlmZjUzNGJiOCJ9.GJQc_g.yuNNYC0r31SrSdo90lF9BmB-Ezo; + Expires=Sun, 25-Feb-2024 16:25:34 GMT; Secure; HttpOnly; Path=/ Strict-Transport-Security: max-age=31536000; includeSubDomains; preload X-Content-Type-Options: nosniff X-Frame-Options: ALLOW-FROM https://pagure.io/ @@ -95,7 +101,7 @@ requests.sessions: reason: OK status_code: 200 - metadata: - latency: 0.3363535404205322 + latency: 0.29949498176574707 module_call_list: - unittest.case - requre.record_and_replace @@ -107,6 +113,12 @@ requests.sessions: - ogr.abstract - ogr.services.pagure.project - ogr.abstract + - ogr.services.pagure.project + - ogr.abstract + - ogr.services.pagure.project + - ogr.abstract + - ogr.services.pagure.project + - ogr.abstract - ogr.services.pagure.service - ogr.abstract - ogr.services.pagure.service @@ -131,6 +143,7 @@ requests.sessions: - jscotka - lbarczio - mfocko + - nforro - nikromen collaborator: [] commit: [] @@ -140,7 +153,7 @@ requests.sessions: close_status: [] custom_keys: [] date_created: '1570568389' - date_modified: '1651242136' + date_modified: '1696856843' description: Testing repository for python-ogr package. full_url: https://pagure.io/ogr-tests fullname: ogr-tests @@ -158,23 +171,22 @@ requests.sessions: name: lachmanfrantisek url_path: user/lachmanfrantisek _next: null - elapsed: 0.335742 + elapsed: 0.2 encoding: utf-8 headers: Connection: Keep-Alive - Content-Length: '965' - Content-Security-Policy: default-src 'self';script-src 'self' 'nonce-m92xxapHybGIiWlLLbMcM991q'; - style-src 'self' 'nonce-m92xxapHybGIiWlLLbMcM991q'; object-src 'none';base-uri - 'self';img-src 'self' https:;connect-src 'self' https://pagure.io:8088;frame-src - https://docs.pagure.org;frame-ancestors https://pagure.io; + Content-Length: '982' + Content-Security-Policy: default-src 'self';script-src 'self' 'nonce-YqLDC0BS8d7iY8mKO7VtBbIne' + https://apps.fedoraproject.org; style-src 'self' 'nonce-YqLDC0BS8d7iY8mKO7VtBbIne'; + object-src 'none';base-uri 'self';img-src 'self' https:; Content-Type: application/json - Date: Wed, 14 Sep 2022 13:38:18 GMT + Date: Fri, 01 Nov 2019 13-36-03 GMT Keep-Alive: timeout=5, max=98 Referrer-Policy: same-origin Server: Apache/2.4.37 (Red Hat Enterprise Linux) OpenSSL/1.1.1k mod_wsgi/4.6.4 Python/3.6 - Set-Cookie: pagure=eyJfcGVybWFuZW50Ijp0cnVlLCJjc3JmX3Rva2VuIjoiMzcxOTkwNDczMWJjNjNkZDgzZGRjMmRhZWI3YmQwZjlhZDU2NzQxMyJ9.FgNqyg.tRnRwzBRDH4ly9uv4AcO5Gd3RJM; - Expires=Sat, 15-Oct-2022 13:38:18 GMT; Secure; HttpOnly; Path=/ + Set-Cookie: pagure=eyJfcGVybWFuZW50Ijp0cnVlLCJjc3JmX3Rva2VuIjoiYjFjNGJjMjBjNzQwM2ZlMWE1OWU4MjIxYmI0OGQ2YzlmZjUzNGJiOCJ9.GJQc_g.yuNNYC0r31SrSdo90lF9BmB-Ezo; + Expires=Sun, 25-Feb-2024 16:25:34 GMT; Secure; HttpOnly; Path=/ Strict-Transport-Security: max-age=31536000; includeSubDomains; preload X-Content-Type-Options: nosniff X-Frame-Options: ALLOW-FROM https://pagure.io/ @@ -183,7 +195,7 @@ requests.sessions: reason: OK status_code: 200 - metadata: - latency: 0.20552778244018555 + latency: 0.31078648567199707 module_call_list: - unittest.case - requre.record_and_replace @@ -195,6 +207,12 @@ requests.sessions: - ogr.abstract - ogr.services.pagure.project - ogr.abstract + - ogr.services.pagure.project + - ogr.abstract + - ogr.services.pagure.project + - ogr.abstract + - ogr.services.pagure.project + - ogr.abstract - ogr.services.pagure.service - ogr.abstract - ogr.services.pagure.service @@ -219,6 +237,7 @@ requests.sessions: - jscotka - lbarczio - mfocko + - nforro - nikromen collaborator: [] commit: [] @@ -228,7 +247,7 @@ requests.sessions: close_status: [] custom_keys: [] date_created: '1570568389' - date_modified: '1651242136' + date_modified: '1696856843' description: Testing repository for python-ogr package. full_url: https://pagure.io/ogr-tests fullname: ogr-tests @@ -246,23 +265,304 @@ requests.sessions: name: lachmanfrantisek url_path: user/lachmanfrantisek _next: null - elapsed: 0.204918 + elapsed: 0.2 encoding: utf-8 headers: Connection: Keep-Alive - Content-Length: '965' - Content-Security-Policy: default-src 'self';script-src 'self' 'nonce-dLCavgVgZ0hmZ8ssQXCUp0SKr'; - style-src 'self' 'nonce-dLCavgVgZ0hmZ8ssQXCUp0SKr'; object-src 'none';base-uri - 'self';img-src 'self' https:;connect-src 'self' https://pagure.io:8088;frame-src - https://docs.pagure.org;frame-ancestors https://pagure.io; + Content-Length: '982' + Content-Security-Policy: default-src 'self';script-src 'self' 'nonce-YqLDC0BS8d7iY8mKO7VtBbIne' + https://apps.fedoraproject.org; style-src 'self' 'nonce-YqLDC0BS8d7iY8mKO7VtBbIne'; + object-src 'none';base-uri 'self';img-src 'self' https:; Content-Type: application/json - Date: Wed, 14 Sep 2022 13:38:19 GMT + Date: Fri, 01 Nov 2019 13-36-03 GMT Keep-Alive: timeout=5, max=97 Referrer-Policy: same-origin Server: Apache/2.4.37 (Red Hat Enterprise Linux) OpenSSL/1.1.1k mod_wsgi/4.6.4 Python/3.6 - Set-Cookie: pagure=eyJfcGVybWFuZW50Ijp0cnVlLCJjc3JmX3Rva2VuIjoiMzcxOTkwNDczMWJjNjNkZDgzZGRjMmRhZWI3YmQwZjlhZDU2NzQxMyJ9.FgNqyw.HA85AcfXffFuUfYgYH2-mCJin9E; - Expires=Sat, 15-Oct-2022 13:38:19 GMT; Secure; HttpOnly; Path=/ + Set-Cookie: pagure=eyJfcGVybWFuZW50Ijp0cnVlLCJjc3JmX3Rva2VuIjoiYjFjNGJjMjBjNzQwM2ZlMWE1OWU4MjIxYmI0OGQ2YzlmZjUzNGJiOCJ9.GJQc_w.OhqnHeHKbCyyLt96Iy90FHgAfC0; + Expires=Sun, 25-Feb-2024 16:25:35 GMT; Secure; HttpOnly; Path=/ + Strict-Transport-Security: max-age=31536000; includeSubDomains; preload + X-Content-Type-Options: nosniff + X-Frame-Options: ALLOW-FROM https://pagure.io/ + X-Xss-Protection: 1; mode=block + raw: !!binary "" + reason: OK + status_code: 200 + - metadata: + latency: 0.3124263286590576 + module_call_list: + - unittest.case + - requre.record_and_replace + - tests.integration.pagure.test_generic_commands + - ogr.abstract + - ogr.services.pagure.project + - ogr.abstract + - ogr.services.pagure.project + - ogr.abstract + - ogr.services.pagure.project + - ogr.abstract + - ogr.services.pagure.project + - ogr.abstract + - ogr.services.pagure.project + - ogr.abstract + - ogr.services.pagure.project + - ogr.abstract + - ogr.services.pagure.service + - ogr.abstract + - ogr.services.pagure.service + - ogr.abstract + - ogr.services.pagure.service + - requests.sessions + - requre.objects + - requre.cassette + - requests.sessions + - send + output: + __store_indicator: 2 + _content: + access_groups: + admin: [] + collaborator: [] + commit: [] + ticket: [] + access_users: + admin: + - jpopelka + - jscotka + - lbarczio + - mfocko + - nforro + - nikromen + collaborator: [] + commit: [] + owner: + - lachmanfrantisek + ticket: [] + close_status: [] + custom_keys: [] + date_created: '1570568389' + date_modified: '1696856843' + description: Testing repository for python-ogr package. + full_url: https://pagure.io/ogr-tests + fullname: ogr-tests + id: 6826 + milestones: {} + name: ogr-tests + namespace: null + parent: null + priorities: {} + tags: [] + url_path: ogr-tests + user: + full_url: https://pagure.io/user/lachmanfrantisek + fullname: "Franti\u0161ek Lachman" + name: lachmanfrantisek + url_path: user/lachmanfrantisek + _next: null + elapsed: 0.2 + encoding: utf-8 + headers: + Connection: Keep-Alive + Content-Length: '982' + Content-Security-Policy: default-src 'self';script-src 'self' 'nonce-YqLDC0BS8d7iY8mKO7VtBbIne' + https://apps.fedoraproject.org; style-src 'self' 'nonce-YqLDC0BS8d7iY8mKO7VtBbIne'; + object-src 'none';base-uri 'self';img-src 'self' https:; + Content-Type: application/json + Date: Fri, 01 Nov 2019 13-36-03 GMT + Keep-Alive: timeout=5, max=96 + Referrer-Policy: same-origin + Server: Apache/2.4.37 (Red Hat Enterprise Linux) OpenSSL/1.1.1k mod_wsgi/4.6.4 + Python/3.6 + Set-Cookie: pagure=eyJfcGVybWFuZW50Ijp0cnVlLCJjc3JmX3Rva2VuIjoiYjFjNGJjMjBjNzQwM2ZlMWE1OWU4MjIxYmI0OGQ2YzlmZjUzNGJiOCJ9.GJQc_w.OhqnHeHKbCyyLt96Iy90FHgAfC0; + Expires=Sun, 25-Feb-2024 16:25:35 GMT; Secure; HttpOnly; Path=/ + Strict-Transport-Security: max-age=31536000; includeSubDomains; preload + X-Content-Type-Options: nosniff + X-Frame-Options: ALLOW-FROM https://pagure.io/ + X-Xss-Protection: 1; mode=block + raw: !!binary "" + reason: OK + status_code: 200 + - metadata: + latency: 0.3024258613586426 + module_call_list: + - unittest.case + - requre.record_and_replace + - tests.integration.pagure.test_generic_commands + - ogr.abstract + - ogr.services.pagure.project + - ogr.abstract + - ogr.services.pagure.project + - ogr.abstract + - ogr.services.pagure.project + - ogr.abstract + - ogr.services.pagure.project + - ogr.abstract + - ogr.services.pagure.project + - ogr.abstract + - ogr.services.pagure.project + - ogr.abstract + - ogr.services.pagure.service + - ogr.abstract + - ogr.services.pagure.service + - ogr.abstract + - ogr.services.pagure.service + - requests.sessions + - requre.objects + - requre.cassette + - requests.sessions + - send + output: + __store_indicator: 2 + _content: + access_groups: + admin: [] + collaborator: [] + commit: [] + ticket: [] + access_users: + admin: + - jpopelka + - jscotka + - lbarczio + - mfocko + - nforro + - nikromen + collaborator: [] + commit: [] + owner: + - lachmanfrantisek + ticket: [] + close_status: [] + custom_keys: [] + date_created: '1570568389' + date_modified: '1696856843' + description: Testing repository for python-ogr package. + full_url: https://pagure.io/ogr-tests + fullname: ogr-tests + id: 6826 + milestones: {} + name: ogr-tests + namespace: null + parent: null + priorities: {} + tags: [] + url_path: ogr-tests + user: + full_url: https://pagure.io/user/lachmanfrantisek + fullname: "Franti\u0161ek Lachman" + name: lachmanfrantisek + url_path: user/lachmanfrantisek + _next: null + elapsed: 0.2 + encoding: utf-8 + headers: + Connection: Keep-Alive + Content-Length: '982' + Content-Security-Policy: default-src 'self';script-src 'self' 'nonce-YqLDC0BS8d7iY8mKO7VtBbIne' + https://apps.fedoraproject.org; style-src 'self' 'nonce-YqLDC0BS8d7iY8mKO7VtBbIne'; + object-src 'none';base-uri 'self';img-src 'self' https:; + Content-Type: application/json + Date: Fri, 01 Nov 2019 13-36-03 GMT + Keep-Alive: timeout=5, max=95 + Referrer-Policy: same-origin + Server: Apache/2.4.37 (Red Hat Enterprise Linux) OpenSSL/1.1.1k mod_wsgi/4.6.4 + Python/3.6 + Set-Cookie: pagure=eyJfcGVybWFuZW50Ijp0cnVlLCJjc3JmX3Rva2VuIjoiYjFjNGJjMjBjNzQwM2ZlMWE1OWU4MjIxYmI0OGQ2YzlmZjUzNGJiOCJ9.GJQc_w.OhqnHeHKbCyyLt96Iy90FHgAfC0; + Expires=Sun, 25-Feb-2024 16:25:35 GMT; Secure; HttpOnly; Path=/ + Strict-Transport-Security: max-age=31536000; includeSubDomains; preload + X-Content-Type-Options: nosniff + X-Frame-Options: ALLOW-FROM https://pagure.io/ + X-Xss-Protection: 1; mode=block + raw: !!binary "" + reason: OK + status_code: 200 + - metadata: + latency: 0.28281688690185547 + module_call_list: + - unittest.case + - requre.record_and_replace + - tests.integration.pagure.test_generic_commands + - ogr.abstract + - ogr.services.pagure.project + - ogr.abstract + - ogr.services.pagure.project + - ogr.abstract + - ogr.services.pagure.project + - ogr.abstract + - ogr.services.pagure.project + - ogr.abstract + - ogr.services.pagure.project + - ogr.abstract + - ogr.services.pagure.project + - ogr.abstract + - ogr.services.pagure.service + - ogr.abstract + - ogr.services.pagure.service + - ogr.abstract + - ogr.services.pagure.service + - requests.sessions + - requre.objects + - requre.cassette + - requests.sessions + - send + output: + __store_indicator: 2 + _content: + access_groups: + admin: [] + collaborator: [] + commit: [] + ticket: [] + access_users: + admin: + - jpopelka + - jscotka + - lbarczio + - mfocko + - nforro + - nikromen + collaborator: [] + commit: [] + owner: + - lachmanfrantisek + ticket: [] + close_status: [] + custom_keys: [] + date_created: '1570568389' + date_modified: '1696856843' + description: Testing repository for python-ogr package. + full_url: https://pagure.io/ogr-tests + fullname: ogr-tests + id: 6826 + milestones: {} + name: ogr-tests + namespace: null + parent: null + priorities: {} + tags: [] + url_path: ogr-tests + user: + full_url: https://pagure.io/user/lachmanfrantisek + fullname: "Franti\u0161ek Lachman" + name: lachmanfrantisek + url_path: user/lachmanfrantisek + _next: null + elapsed: 0.2 + encoding: utf-8 + headers: + Connection: Keep-Alive + Content-Length: '982' + Content-Security-Policy: default-src 'self';script-src 'self' 'nonce-YqLDC0BS8d7iY8mKO7VtBbIne' + https://apps.fedoraproject.org; style-src 'self' 'nonce-YqLDC0BS8d7iY8mKO7VtBbIne'; + object-src 'none';base-uri 'self';img-src 'self' https:; + Content-Type: application/json + Date: Fri, 01 Nov 2019 13-36-03 GMT + Keep-Alive: timeout=5, max=94 + Referrer-Policy: same-origin + Server: Apache/2.4.37 (Red Hat Enterprise Linux) OpenSSL/1.1.1k mod_wsgi/4.6.4 + Python/3.6 + Set-Cookie: pagure=eyJfcGVybWFuZW50Ijp0cnVlLCJjc3JmX3Rva2VuIjoiYjFjNGJjMjBjNzQwM2ZlMWE1OWU4MjIxYmI0OGQ2YzlmZjUzNGJiOCJ9.GJQdAA.griFdeF5GhE2zVs7nAUOY9EDq2c; + Expires=Sun, 25-Feb-2024 16:25:36 GMT; Secure; HttpOnly; Path=/ Strict-Transport-Security: max-age=31536000; includeSubDomains; preload X-Content-Type-Options: nosniff X-Frame-Options: ALLOW-FROM https://pagure.io/ @@ -273,7 +573,7 @@ requests.sessions: POST: https://pagure.io/api/0/-/whoami: - metadata: - latency: 0.5923054218292236 + latency: 0.8399302959442139 module_call_list: - unittest.case - requre.record_and_replace @@ -297,25 +597,24 @@ requests.sessions: output: __store_indicator: 2 _content: - username: nikromen + username: lbarczio _next: null - elapsed: 0.591343 + elapsed: 0.2 encoding: utf-8 headers: Connection: Upgrade, Keep-Alive Content-Length: '29' - Content-Security-Policy: default-src 'self';script-src 'self' 'nonce-DCGp0w9wU5uOLfaj2aMoem4CZ'; - style-src 'self' 'nonce-DCGp0w9wU5uOLfaj2aMoem4CZ'; object-src 'none';base-uri - 'self';img-src 'self' https:;connect-src 'self' https://pagure.io:8088;frame-src - https://docs.pagure.org;frame-ancestors https://pagure.io; + Content-Security-Policy: default-src 'self';script-src 'self' 'nonce-YqLDC0BS8d7iY8mKO7VtBbIne' + https://apps.fedoraproject.org; style-src 'self' 'nonce-YqLDC0BS8d7iY8mKO7VtBbIne'; + object-src 'none';base-uri 'self';img-src 'self' https:; Content-Type: application/json - Date: Wed, 14 Sep 2022 13:38:18 GMT + Date: Fri, 01 Nov 2019 13-36-03 GMT Keep-Alive: timeout=5, max=100 Referrer-Policy: same-origin Server: Apache/2.4.37 (Red Hat Enterprise Linux) OpenSSL/1.1.1k mod_wsgi/4.6.4 Python/3.6 - Set-Cookie: pagure=eyJfcGVybWFuZW50Ijp0cnVlLCJjc3JmX3Rva2VuIjoiMzcxOTkwNDczMWJjNjNkZDgzZGRjMmRhZWI3YmQwZjlhZDU2NzQxMyJ9.FgNqyg.tRnRwzBRDH4ly9uv4AcO5Gd3RJM; - Expires=Sat, 15-Oct-2022 13:38:18 GMT; Secure; HttpOnly; Path=/ + Set-Cookie: pagure=eyJfcGVybWFuZW50Ijp0cnVlLCJjc3JmX3Rva2VuIjoiYjFjNGJjMjBjNzQwM2ZlMWE1OWU4MjIxYmI0OGQ2YzlmZjUzNGJiOCJ9.GJQc_g.yuNNYC0r31SrSdo90lF9BmB-Ezo; + Expires=Sun, 25-Feb-2024 16:25:34 GMT; Secure; HttpOnly; Path=/ Strict-Transport-Security: max-age=31536000; includeSubDomains; preload Upgrade: h2,h2c X-Content-Type-Options: nosniff diff --git a/tests/integration/pagure/test_data/test_service/Service.test_get_group.yaml b/tests/integration/pagure/test_data/test_service/Service.test_get_group.yaml new file mode 100644 index 00000000..7b8c2b09 --- /dev/null +++ b/tests/integration/pagure/test_data/test_service/Service.test_get_group.yaml @@ -0,0 +1,78 @@ +_requre: + DataTypes: 1 + key_strategy: StorageKeysInspectSimple + version_storage_file: 3 +requests.sessions: + send: + GET: + https://pagure.io/api/0/group/packit-service: + - metadata: + latency: 0.48254823684692383 + module_call_list: + - unittest.case + - requre.record_and_replace + - tests.integration.pagure.test_service + - ogr.abstract + - ogr.services.pagure.service + - ogr.abstract + - ogr.services.pagure.service + - ogr.abstract + - ogr.services.pagure.service + - ogr.abstract + - ogr.services.pagure.service + - requests.sessions + - requre.objects + - requre.cassette + - requests.sessions + - send + output: + __store_indicator: 2 + _content: + creator: + default_email: flachman@redhat.com + emails: + - flachman@redhat.com + - lachmanfrantisek@gmail.com + full_url: https://pagure.io/user/lachmanfrantisek + fullname: "Franti\u0161ek Lachman" + name: lachmanfrantisek + url_path: user/lachmanfrantisek + date_created: '1570798102' + description: Packit related projects. + display_name: packit-service + full_url: https://pagure.io/group/packit-service + group_type: user + members: + - dhodovsk + - ttomecek + - lachmanfrantisek + - mfocko + - jscotka + - lbarczio + - jpopelka + name: packit-service + _next: null + elapsed: 0.2 + encoding: utf-8 + headers: + Connection: Upgrade, Keep-Alive + Content-Length: '703' + Content-Security-Policy: default-src 'self';script-src 'self' 'nonce-YqLDC0BS8d7iY8mKO7VtBbIne' + https://apps.fedoraproject.org; style-src 'self' 'nonce-YqLDC0BS8d7iY8mKO7VtBbIne'; + object-src 'none';base-uri 'self';img-src 'self' https:; + Content-Type: application/json + Date: Fri, 01 Nov 2019 13-36-03 GMT + Keep-Alive: timeout=5, max=100 + Referrer-Policy: same-origin + Server: Apache/2.4.37 (Red Hat Enterprise Linux) OpenSSL/1.1.1k mod_wsgi/4.6.4 + Python/3.6 + Set-Cookie: pagure=eyJfcGVybWFuZW50Ijp0cnVlLCJjc3JmX3Rva2VuIjoiMTM1ZDNkOWY3NTMwMmU4OWE4ZmZjZmQxOTg5ZmI3MDIyNjk1ZTVhMyJ9.GJQARQ.eStdoc-0BudOfITKLj-odOX5QbQ; + Expires=Sun, 25-Feb-2024 14:23:01 GMT; Secure; HttpOnly; Path=/ + Strict-Transport-Security: max-age=31536000; includeSubDomains; preload + Upgrade: h2,h2c + X-Content-Type-Options: nosniff + X-Frame-Options: ALLOW-FROM https://pagure.io/ + X-Xss-Protection: 1; mode=block + raw: !!binary "" + reason: OK + status_code: 200 diff --git a/tests/integration/pagure/test_generic_commands.py b/tests/integration/pagure/test_generic_commands.py index a3dd4382..7c7d66ea 100644 --- a/tests/integration/pagure/test_generic_commands.py +++ b/tests/integration/pagure/test_generic_commands.py @@ -119,11 +119,22 @@ def test_pr_permissions(self): assert "lachmanfrantisek" in owners assert self.ogr_project.can_merge_pr("lachmanfrantisek") project = self.service.get_project( - repo=f"playground-{self.service.user.get_username()}", + repo="ogr-tests-group", namespace=None, ) groups = project.which_groups_can_merge_pr() - assert "packit-test-group" in groups + assert "packit-service" in groups + assert project.can_merge_pr("lachmanfrantisek") + + def test_get_users_with_given_access(self): + project = self.service.get_project( + repo="ogr-tests-group", + namespace=None, + ) + users = project.get_users_with_given_access([AccessLevel.maintain]) + + assert "lbarczio" in users + assert "mfocko" in users def test_get_web_url(self): url = self.ogr_project.get_web_url() diff --git a/tests/integration/pagure/test_service.py b/tests/integration/pagure/test_service.py index b5051623..5ee9f2c5 100644 --- a/tests/integration/pagure/test_service.py +++ b/tests/integration/pagure/test_service.py @@ -83,3 +83,14 @@ def test_project_create_unauthorized_namespace(self): self.service.project_create(repo=name, namespace=namespace) project = self.service.get_project(repo=name, namespace=namespace) assert not project.exists() + + def test_get_group(self): + name = "packit-service" + group = self.service.get_group(name) + assert group is not None + assert group.name == name + + members = group.members + assert members + assert len(members) > 1 + assert "lbarczio" in members