From d3a8777244ebc107e1124c4fab441b5e0eb75f44 Mon Sep 17 00:00:00 2001 From: Chad Smith Date: Wed, 20 Sep 2017 16:41:31 -0600 Subject: tests: Add cloudinit package to all test targets The package cloudinit was sparsely added to only the makefile's unittest target and tox's py3 target. This branch adds cloudinit package to 'make unittest3' and all tox environments. It tweaks one cloudinit unit test to use mocked_object.call_count instead of mocked_object.assert_called_once which is not defined in some python unittest versions. --- cloudinit/net/tests/test_dhcp.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'cloudinit/net') diff --git a/cloudinit/net/tests/test_dhcp.py b/cloudinit/net/tests/test_dhcp.py index 1324c3d0..a38edaec 100644 --- a/cloudinit/net/tests/test_dhcp.py +++ b/cloudinit/net/tests/test_dhcp.py @@ -107,7 +107,8 @@ class TestDHCPDiscoveryClean(CiTestCase): 'os.getuid': 0}, maybe_perform_dhcp_discovery) self.assertEqual({'address': '192.168.2.2'}, retval) - m_dhcp.assert_called_once() + self.assertEqual( + 1, m_dhcp.call_count, 'dhcp_discovery not called once') call = m_dhcp.call_args_list[0] self.assertEqual('/sbin/dhclient', call[0][0]) self.assertEqual('eth9', call[0][1]) -- cgit v1.2.3