From 8ae5b0611c32d5dd34619edd8af553ae7633740d Mon Sep 17 00:00:00 2001 From: Ross Brattain Date: Wed, 20 Sep 2017 14:42:00 -0700 Subject: cgnapt: mock time.sleep in unitests Change-Id: I26957977e6dcd0392078a543a6907a550711c702 Signed-off-by: Ross Brattain --- tests/unit/network_services/vnf_generic/vnf/test_cgnapt_vnf.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'tests') diff --git a/tests/unit/network_services/vnf_generic/vnf/test_cgnapt_vnf.py b/tests/unit/network_services/vnf_generic/vnf/test_cgnapt_vnf.py index 76f2d5b5d..0a4c12446 100644 --- a/tests/unit/network_services/vnf_generic/vnf/test_cgnapt_vnf.py +++ b/tests/unit/network_services/vnf_generic/vnf/test_cgnapt_vnf.py @@ -311,8 +311,9 @@ class TestCgnaptApproxVnf(unittest.TestCase): cgnapt_approx_vnf = CgnaptApproxVnf(name, vnfd) self.assertIsNone(cgnapt_approx_vnf._vnf_process) + @mock.patch('yardstick.network_services.vnf_generic.vnf.sample_vnf.time') @mock.patch(SSH_HELPER) - def test_collect_kpi(self, ssh, mock_process): + def test_collect_kpi(self, ssh, mock_time, mock_process): mock_ssh(ssh) vnfd = self.VNFD['vnfd:vnfd-catalog']['vnfd'][0] @@ -324,8 +325,9 @@ class TestCgnaptApproxVnf(unittest.TestCase): result = {'packets_dropped': 0, 'packets_fwd': 0, 'packets_in': 0} self.assertEqual(result, cgnapt_approx_vnf.collect_kpi()) + @mock.patch('yardstick.network_services.vnf_generic.vnf.sample_vnf.time') @mock.patch(SSH_HELPER) - def test_vnf_execute_command(self, ssh, mock_process): + def test_vnf_execute_command(self, ssh, mock_time, mock_process): mock_ssh(ssh) vnfd = self.VNFD['vnfd:vnfd-catalog']['vnfd'][0] -- cgit 1.2.3-korg