summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorChris Patterson <cpatterson@microsoft.com>2022-02-11 23:40:45 -0500
committerGitHub <noreply@github.com>2022-02-11 22:40:45 -0600
commit0b41b359a70bbbf3a648862a9b849d60b9ff6c3b (patch)
treec53959a1e5346db352e5b5a14a47180092c3e3c4 /tests
parenta62d04e081831be82b3d26c94fee5aa40d7c0802 (diff)
downloadvyos-cloud-init-0b41b359a70bbbf3a648862a9b849d60b9ff6c3b.tar.gz
vyos-cloud-init-0b41b359a70bbbf3a648862a9b849d60b9ff6c3b.zip
sources/azure: address mypy/pyright typing complaints (#1245)
Raise runtime errors for unhandled cases which would cause other exceptions. Ignore types for a few cases where a non-trivial refactor would be required to prevent the warning. Signed-off-by: Chris Patterson <cpatterson@microsoft.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/unittests/sources/test_azure.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/unittests/sources/test_azure.py b/tests/unittests/sources/test_azure.py
index a47ed611..bd525b13 100644
--- a/tests/unittests/sources/test_azure.py
+++ b/tests/unittests/sources/test_azure.py
@@ -2993,7 +2993,7 @@ class TestPreprovisioningHotAttachNics(CiTestCase):
@mock.patch(MOCKPATH + "net.is_up", autospec=True)
@mock.patch(MOCKPATH + "util.write_file")
- @mock.patch("cloudinit.net.read_sys_net")
+ @mock.patch("cloudinit.net.read_sys_net", return_value="device-id")
@mock.patch("cloudinit.distros.networking.LinuxNetworking.try_set_link_up")
def test_wait_for_link_up_checks_link_after_sleep(
self, m_try_set_link_up, m_read_sys_net, m_writefile, m_is_up
@@ -3023,7 +3023,7 @@ class TestPreprovisioningHotAttachNics(CiTestCase):
self.assertEqual(2, m_is_up.call_count)
@mock.patch(MOCKPATH + "util.write_file")
- @mock.patch("cloudinit.net.read_sys_net")
+ @mock.patch("cloudinit.net.read_sys_net", return_value="device-id")
@mock.patch("cloudinit.distros.networking.LinuxNetworking.try_set_link_up")
def test_wait_for_link_up_writes_to_device_file(
self, m_is_link_up, m_read_sys_net, m_writefile