summaryrefslogtreecommitdiff
path: root/tests/unittests/test_datasource
diff options
context:
space:
mode:
authorJoshua Powers <josh.powers@canonical.com>2020-06-02 09:06:07 -0700
committerGitHub <noreply@github.com>2020-06-02 12:06:07 -0400
commitd53921ea3396c8301c65cad3abf04b4542d4b7a0 (patch)
treed19c4271786853d2da050749dc5a65dc95878327 /tests/unittests/test_datasource
parent5f7825e22241423322dbe628de1b00289cf34114 (diff)
downloadvyos-cloud-init-d53921ea3396c8301c65cad3abf04b4542d4b7a0.tar.gz
vyos-cloud-init-d53921ea3396c8301c65cad3abf04b4542d4b7a0.zip
test: fix all flake8 E121 and E123 errors (#404)
This fixes issues with closing brackets not matching the opening bracket's line and continuation line under-idented for hanging indent.
Diffstat (limited to 'tests/unittests/test_datasource')
-rw-r--r--tests/unittests/test_datasource/test_aliyun.py2
-rw-r--r--tests/unittests/test_datasource/test_azure.py8
-rw-r--r--tests/unittests/test_datasource/test_ec2.py15
-rw-r--r--tests/unittests/test_datasource/test_scaleway.py39
4 files changed, 36 insertions, 28 deletions
diff --git a/tests/unittests/test_datasource/test_aliyun.py b/tests/unittests/test_datasource/test_aliyun.py
index 1e66fcdb..b626229e 100644
--- a/tests/unittests/test_datasource/test_aliyun.py
+++ b/tests/unittests/test_datasource/test_aliyun.py
@@ -143,7 +143,7 @@ class TestAliYunDatasource(test_helpers.HttprettyTestCase):
self.assertEqual('aliyun', self.ds.cloud_name)
self.assertEqual('ec2', self.ds.platform)
self.assertEqual(
- 'metadata (http://100.100.100.200)', self.ds.subplatform)
+ 'metadata (http://100.100.100.200)', self.ds.subplatform)
@mock.patch("cloudinit.sources.DataSourceAliYun._is_aliyun")
def test_returns_false_when_not_on_aliyun(self, m_is_aliyun):
diff --git a/tests/unittests/test_datasource/test_azure.py b/tests/unittests/test_datasource/test_azure.py
index 2f8561cb..d8d812e3 100644
--- a/tests/unittests/test_datasource/test_azure.py
+++ b/tests/unittests/test_datasource/test_azure.py
@@ -114,14 +114,14 @@ NETWORK_METADATA = {
"ipv4": {
"subnet": [
{
- "prefix": "24",
- "address": "10.0.0.0"
+ "prefix": "24",
+ "address": "10.0.0.0"
}
],
"ipAddress": [
{
- "privateIpAddress": "10.0.0.4",
- "publicIpAddress": "104.46.124.81"
+ "privateIpAddress": "10.0.0.4",
+ "publicIpAddress": "104.46.124.81"
}
]
}
diff --git a/tests/unittests/test_datasource/test_ec2.py b/tests/unittests/test_datasource/test_ec2.py
index ad1ea595..80e69c03 100644
--- a/tests/unittests/test_datasource/test_ec2.py
+++ b/tests/unittests/test_datasource/test_ec2.py
@@ -576,7 +576,8 @@ class TestEc2(test_helpers.HttprettyTestCase):
md=None)
conn_error = requests.exceptions.ConnectionError(
- '[Errno 113] no route to host')
+ '[Errno 113] no route to host'
+ )
mock_success = mock.MagicMock(contents=b'fakesuccess')
mock_success.ok.return_value = True
@@ -777,12 +778,12 @@ class TestGetSecondaryAddresses(test_helpers.CiTestCase):
'2600:1f16:292:100:f153:12a3:c37c:11f9/128'],
ec2.get_secondary_addresses(invalid_cidr_md, self.mac))
expected_logs = [
- "WARNING: Could not parse subnet-ipv4-cidr-block"
- " something-unexpected for mac 06:17:04:d7:26:ff."
- " ipv4 network config prefix defaults to /24",
- "WARNING: Could not parse subnet-ipv6-cidr-block"
- " not/sure/what/this/is for mac 06:17:04:d7:26:ff."
- " ipv6 network config prefix defaults to /128"
+ "WARNING: Could not parse subnet-ipv4-cidr-block"
+ " something-unexpected for mac 06:17:04:d7:26:ff."
+ " ipv4 network config prefix defaults to /24",
+ "WARNING: Could not parse subnet-ipv6-cidr-block"
+ " not/sure/what/this/is for mac 06:17:04:d7:26:ff."
+ " ipv6 network config prefix defaults to /128"
]
logs = self.logs.getvalue()
for log in expected_logs:
diff --git a/tests/unittests/test_datasource/test_scaleway.py b/tests/unittests/test_datasource/test_scaleway.py
index 1b4dd0ad..15441454 100644
--- a/tests/unittests/test_datasource/test_scaleway.py
+++ b/tests/unittests/test_datasource/test_scaleway.py
@@ -371,25 +371,32 @@ class TestDataSourceScaleway(HttprettyTestCase):
m_get_cmdline.return_value = 'scaleway'
fallback_nic.return_value = 'ens2'
self.datasource.metadata['ipv6'] = {
- 'address': '2000:abc:4444:9876::42:999',
- 'gateway': '2000:abc:4444:9876::42:000',
- 'netmask': '127',
- }
+ 'address': '2000:abc:4444:9876::42:999',
+ 'gateway': '2000:abc:4444:9876::42:000',
+ 'netmask': '127',
+ }
netcfg = self.datasource.network_config
- resp = {'version': 1,
- 'config': [{
- 'type': 'physical',
- 'name': 'ens2',
- 'subnets': [{'type': 'dhcp4'},
- {'type': 'static',
- 'address': '2000:abc:4444:9876::42:999',
- 'gateway': '2000:abc:4444:9876::42:000',
- 'netmask': '127', }
- ]
-
- }]
+ resp = {
+ 'version': 1,
+ 'config': [
+ {
+ 'type': 'physical',
+ 'name': 'ens2',
+ 'subnets': [
+ {
+ 'type': 'dhcp4'
+ },
+ {
+ 'type': 'static',
+ 'address': '2000:abc:4444:9876::42:999',
+ 'gateway': '2000:abc:4444:9876::42:000',
+ 'netmask': '127',
+ }
+ ]
}
+ ]
+ }
self.assertEqual(netcfg, resp)
@mock.patch('cloudinit.sources.DataSourceScaleway.net.find_fallback_nic')