1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2026-04-04 19:26:58 +00:00

Reformat everything.

This commit is contained in:
Felix Fontein 2025-11-01 12:08:41 +01:00
parent 3f2213791a
commit 340ff8586d
1008 changed files with 61301 additions and 58309 deletions

View file

@ -1,4 +1,3 @@
# Copyright (c) 2023, Zoran Krleza (zoran.krleza@true-north.hr)
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
# SPDX-License-Identifier: GPL-3.0-or-later
@ -15,7 +14,7 @@ PYTHON_GITLAB_MINIMAL_VERSION = (3, 1)
def python_gitlab_version_match_requirement():
return tuple(map(int, gitlab.__version__.split('.'))) >= PYTHON_GITLAB_MINIMAL_VERSION
return tuple(map(int, gitlab.__version__.split("."))) >= PYTHON_GITLAB_MINIMAL_VERSION
def _dummy(x):
@ -26,12 +25,14 @@ def _dummy(x):
pytestmark = []
try:
from .gitlab import (GitlabModuleTestCase,
resp_get_user,
resp_get_project,
resp_list_project_access_tokens,
resp_create_project_access_tokens,
resp_revoke_project_access_tokens)
from .gitlab import (
GitlabModuleTestCase,
resp_get_user,
resp_get_project,
resp_list_project_access_tokens,
resp_create_project_access_tokens,
resp_revoke_project_access_tokens,
)
except ImportError:
pytestmark.append(pytest.mark.skip("Could not load gitlab module required for testing"))
@ -56,7 +57,9 @@ class TestGitlabProjectAccessToken(GitlabModuleTestCase):
def setUp(self):
super().setUp()
if not python_gitlab_version_match_requirement():
self.skipTest(f"python-gitlab {'.'.join(map(str, PYTHON_GITLAB_MINIMAL_VERSION))}+ is needed for gitlab_project_access_token")
self.skipTest(
f"python-gitlab {'.'.join(map(str, PYTHON_GITLAB_MINIMAL_VERSION))}+ is needed for gitlab_project_access_token"
)
self.moduleUtil = GitLabProjectAccessToken(module=self.mock_module, gitlab_instance=self.gitlab_instance)
@ -110,7 +113,9 @@ class TestGitlabProjectAccessToken(GitlabModuleTestCase):
project = self.gitlab_instance.projects.get(1)
self.assertIsNotNone(project)
rvalue = self.moduleUtil.create_access_token(project, {'name': "tokenXYZ", 'scopes': ["api"], 'access_level': 20, 'expires_at': "2024-12-31"})
rvalue = self.moduleUtil.create_access_token(
project, {"name": "tokenXYZ", "scopes": ["api"], "access_level": 20, "expires_at": "2024-12-31"}
)
self.assertEqual(rvalue, True)
self.assertIsNotNone(self.moduleUtil.access_token_object)