X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=tests%2Funit%2Fnetwork_services%2Ftraffic_profile%2Ftest_prox_profile.py;h=078e72b8eee84996e76d48d4846c826435f6e729;hb=5721849f3f08c2c1c89354341115c834e510b3d6;hp=9899d9909615a8afe78d4e6a9bd31b00286737c8;hpb=9a8de3b337c45da22706cac29bc31cda9cf63fa9;p=yardstick.git diff --git a/tests/unit/network_services/traffic_profile/test_prox_profile.py b/tests/unit/network_services/traffic_profile/test_prox_profile.py index 9899d9909..078e72b8e 100644 --- a/tests/unit/network_services/traffic_profile/test_prox_profile.py +++ b/tests/unit/network_services/traffic_profile/test_prox_profile.py @@ -26,6 +26,7 @@ stl_patch.start() if stl_patch: from yardstick.network_services.traffic_profile.prox_profile import ProxProfile + from yardstick.network_services.vnf_generic.vnf.prox_helpers import ProxResourceHelper class TestProxProfile(unittest.TestCase): @@ -62,8 +63,9 @@ class TestProxProfile(unittest.TestCase): } profile = ProxProfile(tp_config) - profile.init(234) - self.assertEqual(profile.queue, 234) + queue = mock.Mock() + profile.init(queue) + self.assertIs(profile.queue, queue) def test_execute_traffic(self): packet_sizes = [ @@ -78,6 +80,13 @@ class TestProxProfile(unittest.TestCase): } traffic_generator = mock.MagicMock() + + setup_helper = traffic_generator.setup_helper + setup_helper.find_in_section.return_value = None + + prox_resource_helper = ProxResourceHelper(setup_helper) + traffic_generator.resource_helper = prox_resource_helper + profile = ProxProfile(tp_config) self.assertFalse(profile.done) @@ -86,6 +95,7 @@ class TestProxProfile(unittest.TestCase): profile.execute_traffic(traffic_generator) self.assertIsNone(profile.execute_traffic(traffic_generator)) + self.assertTrue(profile.done) def test_bounds_iterator(self): tp_config = {