summaryrefslogtreecommitdiff
path: root/cloudinit/net/tests
diff options
context:
space:
mode:
authorChad Smith <chad.smith@canonical.com>2017-09-20 16:41:31 -0600
committerChad Smith <chad.smith@canonical.com>2017-09-20 16:41:31 -0600
commitd3a8777244ebc107e1124c4fab441b5e0eb75f44 (patch)
tree9f58149a2880c728845dabfa9db5c50fcdd77fbd /cloudinit/net/tests
parent82b2da3a56680b43df00ed31837b8650b5971656 (diff)
downloadvyos-cloud-init-d3a8777244ebc107e1124c4fab441b5e0eb75f44.tar.gz
vyos-cloud-init-d3a8777244ebc107e1124c4fab441b5e0eb75f44.zip
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.
Diffstat (limited to 'cloudinit/net/tests')
-rw-r--r--cloudinit/net/tests/test_dhcp.py3
1 files changed, 2 insertions, 1 deletions
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])