1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2026-04-04 11:17:05 +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) 2019, Guillaume Martinez (lunik@tiwabbit.fr)
# 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
@ -18,10 +17,16 @@ def _dummy(x):
pytestmark = []
try:
from .gitlab import (GitlabModuleTestCase,
python_version_match_requirement,
resp_get_group, resp_get_missing_group, resp_create_group,
resp_create_subgroup, resp_delete_group, resp_find_group_project)
from .gitlab import (
GitlabModuleTestCase,
python_version_match_requirement,
resp_get_group,
resp_get_missing_group,
resp_create_group,
resp_create_subgroup,
resp_delete_group,
resp_find_group_project,
)
# GitLab module requirements
if python_version_match_requirement():
@ -65,13 +70,16 @@ class TestGitlabGroup(GitlabModuleTestCase):
@with_httmock(resp_create_group)
def test_create_group(self):
group = self.moduleUtil.create_group({'name': "Foobar Group",
'path': "foo-bar",
'description': "An interesting group",
'project_creation_level': "developer",
'subgroup_creation_level': "maintainer",
'require_two_factor_authentication': True,
})
group = self.moduleUtil.create_group(
{
"name": "Foobar Group",
"path": "foo-bar",
"description": "An interesting group",
"project_creation_level": "developer",
"subgroup_creation_level": "maintainer",
"require_two_factor_authentication": True,
}
)
self.assertEqual(type(group), Group)
self.assertEqual(group.name, "Foobar Group")
@ -84,12 +92,15 @@ class TestGitlabGroup(GitlabModuleTestCase):
@with_httmock(resp_create_subgroup)
def test_create_subgroup(self):
group = self.moduleUtil.create_group({'name': "BarFoo Group",
'path': "bar-foo",
'parent_id': 1,
'project_creation_level': "noone",
'require_two_factor_authentication': True,
})
group = self.moduleUtil.create_group(
{
"name": "BarFoo Group",
"path": "bar-foo",
"parent_id": 1,
"project_creation_level": "noone",
"require_two_factor_authentication": True,
}
)
self.assertEqual(type(group), Group)
self.assertEqual(group.name, "BarFoo Group")
@ -102,11 +113,15 @@ class TestGitlabGroup(GitlabModuleTestCase):
@with_httmock(resp_get_group)
def test_update_group(self):
group = self.gitlab_instance.groups.get(1)
changed, newGroup = self.moduleUtil.update_group(group, {'name': "BarFoo Group",
'visibility': "private",
'project_creation_level': "maintainer",
'require_two_factor_authentication': True,
})
changed, newGroup = self.moduleUtil.update_group(
group,
{
"name": "BarFoo Group",
"visibility": "private",
"project_creation_level": "maintainer",
"require_two_factor_authentication": True,
},
)
self.assertEqual(changed, True)
self.assertEqual(newGroup.name, "BarFoo Group")
@ -114,7 +129,7 @@ class TestGitlabGroup(GitlabModuleTestCase):
self.assertEqual(newGroup.project_creation_level, "maintainer")
self.assertEqual(newGroup.require_two_factor_authentication, True)
changed, newGroup = self.moduleUtil.update_group(group, {'name': "BarFoo Group"})
changed, newGroup = self.moduleUtil.update_group(group, {"name": "BarFoo Group"})
self.assertEqual(changed, False)