From 0f8428f6227106c28615384d49a3e55e5c14dc17 Mon Sep 17 00:00:00 2001 From: James Falcon Date: Fri, 29 Oct 2021 14:54:33 -0500 Subject: Add necessary mocks to test_ovf unit tests (#1087) --- tests/unittests/test_datasource/test_ovf.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tests/unittests/test_datasource/test_ovf.py b/tests/unittests/test_datasource/test_ovf.py index f5818a3a..ad7446f8 100644 --- a/tests/unittests/test_datasource/test_ovf.py +++ b/tests/unittests/test_datasource/test_ovf.py @@ -518,10 +518,16 @@ class TestDatasourceOVF(CiTestCase): 'vmware (%s/seed/ovf-env.xml)' % self.tdir, ds.subplatform) - def test_get_data_vmware_guestinfo_with_network_config(self): + @mock.patch('cloudinit.subp.subp') + @mock.patch('cloudinit.sources.DataSource.persist_instance_data') + def test_get_data_vmware_guestinfo_with_network_config( + self, m_persist, m_subp + ): self._test_get_data_with_network_config(guestinfo=False, iso=True) - def test_get_data_iso9660_with_network_config(self): + @mock.patch('cloudinit.subp.subp') + @mock.patch('cloudinit.sources.DataSource.persist_instance_data') + def test_get_data_iso9660_with_network_config(self, m_persist, m_subp): self._test_get_data_with_network_config(guestinfo=True, iso=False) def _test_get_data_with_network_config(self, guestinfo, iso): -- cgit v1.2.3