diff options
author | James Falcon <james.falcon@canonical.com> | 2021-12-15 20:16:38 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-12-15 19:16:38 -0700 |
commit | bae9b11da9ed7dd0b16fe5adeaf4774b7cc628cf (patch) | |
tree | 1fbb3269fc87e39832e3286ef42eefd2b23fcd44 /tests/unittests/distros/test_arch.py | |
parent | 2bcf4fa972fde686c2e3141c58e640640b44dd00 (diff) | |
download | vyos-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/distros/test_arch.py')
-rw-r--r-- | tests/unittests/distros/test_arch.py | 50 |
1 files changed, 30 insertions, 20 deletions
diff --git a/tests/unittests/distros/test_arch.py b/tests/unittests/distros/test_arch.py index 590ba00e..5446295e 100644 --- a/tests/unittests/distros/test_arch.py +++ b/tests/unittests/distros/test_arch.py @@ -1,15 +1,13 @@ # This file is part of cloud-init. See LICENSE file for license information. -from cloudinit.distros.arch import _render_network from cloudinit import util - -from tests.unittests.helpers import (CiTestCase, dir2dict) +from cloudinit.distros.arch import _render_network +from tests.unittests.helpers import CiTestCase, dir2dict from . import _get_distro class TestArch(CiTestCase): - def test_get_distro(self): distro = _get_distro("arch") hostname = "myhostname" @@ -23,23 +21,35 @@ class TestRenderNetwork(CiTestCase): """Just the most basic static config. note 'lo' should not be rendered as an interface.""" - entries = {'eth0': {'auto': True, - 'dns-nameservers': ['8.8.8.8'], - 'bootproto': 'static', - 'address': '10.0.0.2', - 'gateway': '10.0.0.1', - 'netmask': '255.255.255.0'}, - 'lo': {'auto': True}} + entries = { + "eth0": { + "auto": True, + "dns-nameservers": ["8.8.8.8"], + "bootproto": "static", + "address": "10.0.0.2", + "gateway": "10.0.0.1", + "netmask": "255.255.255.0", + }, + "lo": {"auto": True}, + } target = self.tmp_dir() devs = _render_network(entries, target=target) files = dir2dict(target, prefix=target) - self.assertEqual(['eth0'], devs) + self.assertEqual(["eth0"], devs) self.assertEqual( - {'/etc/netctl/eth0': '\n'.join([ - "Address=10.0.0.2/255.255.255.0", - "Connection=ethernet", - "DNS=('8.8.8.8')", - "Gateway=10.0.0.1", - "IP=static", - "Interface=eth0", ""]), - '/etc/resolv.conf': 'nameserver 8.8.8.8\n'}, files) + { + "/etc/netctl/eth0": "\n".join( + [ + "Address=10.0.0.2/255.255.255.0", + "Connection=ethernet", + "DNS=('8.8.8.8')", + "Gateway=10.0.0.1", + "IP=static", + "Interface=eth0", + "", + ] + ), + "/etc/resolv.conf": "nameserver 8.8.8.8\n", + }, + files, + ) |