From 0b41b359a70bbbf3a648862a9b849d60b9ff6c3b Mon Sep 17 00:00:00 2001 From: Chris Patterson Date: Fri, 11 Feb 2022 23:40:45 -0500 Subject: 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 --- tests/unittests/sources/test_azure.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tests') 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 -- cgit v1.2.3