From bae9b11da9ed7dd0b16fe5adeaf4774b7cc628cf Mon Sep 17 00:00:00 2001 From: James Falcon Date: Wed, 15 Dec 2021 20:16:38 -0600 Subject: Adopt Black and isort (SC-700) (#1157) Applied Black and isort, fixed any linting issues, updated tox.ini and CI. --- .../integration_tests/modules/test_users_groups.py | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) (limited to 'tests/integration_tests/modules/test_users_groups.py') diff --git a/tests/integration_tests/modules/test_users_groups.py b/tests/integration_tests/modules/test_users_groups.py index bcb17b7f..3d1358ce 100644 --- a/tests/integration_tests/modules/test_users_groups.py +++ b/tests/integration_tests/modules/test_users_groups.py @@ -11,7 +11,6 @@ import pytest from tests.integration_tests.clouds import ImageSpecification from tests.integration_tests.instances import IntegrationInstance - USER_DATA = """\ #cloud-config # Add groups to the system @@ -84,7 +83,9 @@ class TestUsersGroups: assert re.search(regex, result.stdout) is not None, ( "'getent {}' resulted in '{}', " "but expected to match regex {}".format( - ' '.join(getent_args), result.stdout, regex)) + " ".join(getent_args), result.stdout, regex + ) + ) def test_user_root_in_secret(self, class_client): """Test root user is in 'secret' group.""" @@ -105,19 +106,21 @@ def test_sudoers_includedir(client: IntegrationInstance): https://github.com/canonical/cloud-init/pull/783 """ if ImageSpecification.from_os_image().release in [ - 'xenial', 'bionic', 'focal' + "xenial", + "bionic", + "focal", ]: raise pytest.skip( - 'Test requires version of sudo installed on groovy and later' + "Test requires version of sudo installed on groovy and later" ) client.execute("sed -i 's/#include/@include/g' /etc/sudoers") - sudoers = client.read_from_file('/etc/sudoers') - if '@includedir /etc/sudoers.d' not in sudoers: + sudoers = client.read_from_file("/etc/sudoers") + if "@includedir /etc/sudoers.d" not in sudoers: client.execute("echo '@includedir /etc/sudoers.d' >> /etc/sudoers") client.instance.clean() client.restart() - sudoers = client.read_from_file('/etc/sudoers') + sudoers = client.read_from_file("/etc/sudoers") - assert '#includedir' not in sudoers - assert sudoers.count('includedir /etc/sudoers.d') == 1 + assert "#includedir" not in sudoers + assert sudoers.count("includedir /etc/sudoers.d") == 1 -- cgit v1.2.3