fixed whitespace in accordance with pep8 sanity checks

This commit is contained in:
Austin Lucas Lake 2025-03-15 08:04:58 -07:00
parent 458648f8fb
commit 13b4cd78ad
No known key found for this signature in database
GPG key ID: 6A37FA54CFCFA4DB

View file

@ -122,6 +122,7 @@ def delete_gpg_key_notfound_mock(url, request):
class TestGithubRepo(unittest.TestCase): class TestGithubRepo(unittest.TestCase):
def setUp(self): def setUp(self):
<<<<<<< Updated upstream
self.module = AnsibleModule( self.module = AnsibleModule(
argument_spec=dict( argument_spec=dict(
state=dict(type='str', default='present', choice=['present', 'absent']), state=dict(type='str', default='present', choice=['present', 'absent']),
@ -134,20 +135,44 @@ class TestGithubRepo(unittest.TestCase):
required_if=[ required_if=[
['state', 'present', ['armored_public_key']], ['state', 'present', ['armored_public_key']],
] ]
=======
self.token = "github_access_token"
self.name = "GPG public key"
self.armored_public_key = "-----BEGIN PGP PUBLIC KEY BLOCK-----\r\n\n\nMy ASCII-armored GPG public key\r\n-----END PGP PUBLIC KEY BLOCK-----"
self.gpg_key_id = 123456789
@with_httmock(create_gpg_key_mock)
def test_create_gpg_key(self):
result = github_gpg_key.run_module(
params=dict(
state="present",
token=self.token,
name=self.name,
armored_public_key=self.armored_public_key
),
check_mode=False
>>>>>>> Stashed changes
) )
@with_httmock(list_gpg_keys_mock) @with_httmock(list_gpg_keys_mock)
@with_httmock(create_gpg_key_mock) @with_httmock(create_gpg_key_mock)
def test_create_gpg_key_repo(self): def test_create_gpg_key_repo(self):
result = github_gpg_key.run_module( result = github_gpg_key.run_module(
module=self.module,
params=dict( params=dict(
<<<<<<< Updated upstream
token="github_access_token", token="github_access_token",
name="GPG public key", name="GPG public key",
armored_public_key="-----BEGIN PGP PUBLIC KEY BLOCK-----\r\n\n\nMy ASCII-armored GPG public key\r\n-----END PGP PUBLIC KEY BLOCK-----", armored_public_key="-----BEGIN PGP PUBLIC KEY BLOCK-----\r\n\n\nMy ASCII-armored GPG public key\r\n-----END PGP PUBLIC KEY BLOCK-----",
state="present", state="present",
force=True force=True
) )
=======
state="absent",
token=self.token,
gpg_key_id=self.gpg_key_id
),
check_mode=False
>>>>>>> Stashed changes
) )
self.assertEqual(result['changed'], True) self.assertEqual(result['changed'], True)
self.assertEqual(result['key']['name'], 'GPG public key') self.assertEqual(result['key']['name'], 'GPG public key')
@ -183,5 +208,6 @@ class TestGithubRepo(unittest.TestCase):
self.assertEqual(result['changed'], False) self.assertEqual(result['changed'], False)
if __name__ == "__main__": if __name__ == "__main__":
unittest.main() unittest.main()