summaryrefslogtreecommitdiff
path: root/tests/unittests/util.py
diff options
context:
space:
mode:
authorJames Falcon <james.falcon@canonical.com>2021-12-15 20:16:38 -0600
committerGitHub <noreply@github.com>2021-12-15 19:16:38 -0700
commitbae9b11da9ed7dd0b16fe5adeaf4774b7cc628cf (patch)
tree1fbb3269fc87e39832e3286ef42eefd2b23fcd44 /tests/unittests/util.py
parent2bcf4fa972fde686c2e3141c58e640640b44dd00 (diff)
downloadvyos-cloud-init-bae9b11da9ed7dd0b16fe5adeaf4774b7cc628cf.tar.gz
vyos-cloud-init-bae9b11da9ed7dd0b16fe5adeaf4774b7cc628cf.zip
Adopt Black and isort (SC-700) (#1157)
Applied Black and isort, fixed any linting issues, updated tox.ini and CI.
Diffstat (limited to 'tests/unittests/util.py')
-rw-r--r--tests/unittests/util.py14
1 files changed, 8 insertions, 6 deletions
diff --git a/tests/unittests/util.py b/tests/unittests/util.py
index 2204c28f..79a6e1d0 100644
--- a/tests/unittests/util.py
+++ b/tests/unittests/util.py
@@ -27,15 +27,17 @@ def get_cloud(distro=None, paths=None, sys_cfg=None, metadata=None):
def abstract_to_concrete(abclass):
"""Takes an abstract class and returns a concrete version of it."""
+
class concreteCls(abclass):
pass
+
concreteCls.__abstractmethods__ = frozenset()
- return type('DummyConcrete' + abclass.__name__, (concreteCls,), {})
+ return type("DummyConcrete" + abclass.__name__, (concreteCls,), {})
class DataSourceTesting(DataSourceNone):
def get_hostname(self, fqdn=False, resolve_ip=False, metadata_only=False):
- return 'hostname'
+ return "hostname"
def persist_instance_data(self):
return True
@@ -46,7 +48,7 @@ class DataSourceTesting(DataSourceNone):
@property
def cloud_name(self):
- return 'testing'
+ return "testing"
class MockDistro(distros.Distro):
@@ -68,7 +70,7 @@ class MockDistro(distros.Distro):
return True
def get_primary_arch(self):
- return 'i386'
+ return "i386"
def get_package_mirror_info(self, arch=None, data_source=None):
pass
@@ -110,7 +112,7 @@ class MockDistro(distros.Distro):
pass
def add_snap_user(self, name, **kwargs):
- return 'snap_user'
+ return "snap_user"
def create_user(self, name, **kwargs):
return True
@@ -124,7 +126,7 @@ class MockDistro(distros.Distro):
def set_passwd(self, user, passwd, hashed=False):
return True
- def ensure_sudo_dir(self, path, sudo_base='/etc/sudoers'):
+ def ensure_sudo_dir(self, path, sudo_base="/etc/sudoers"):
pass
def write_sudo_rules(self, user, rules, sudo_file=None):