Merge "Use "protocol" parameters in iperf3 yaml and task file"
[yardstick.git] / tests / unit / network_services / traffic_profile / test_fixed.py
index f4500dd..eb182a2 100644 (file)
 #
 
 from __future__ import absolute_import
+
 import unittest
 import mock
 
-from yardstick.network_services.traffic_profile.base import TrafficProfile
-from yardstick.network_services.traffic_profile.fixed import FixedProfile
+from tests.unit import STL_MOCKS
+
+STLClient = mock.MagicMock()
+stl_patch = mock.patch.dict("sys.modules", STL_MOCKS)
+stl_patch.start()
+
+if stl_patch:
+    from yardstick.network_services.traffic_profile.base import TrafficProfile
+    from yardstick.network_services.traffic_profile.fixed import FixedProfile
 
 
 class TestFixedProfile(unittest.TestCase):
@@ -66,7 +74,7 @@ class TestFixedProfile(unittest.TestCase):
                     'local_ip': '152.16.100.19',
                     'type': 'PCI-PASSTHROUGH',
                     'netmask': '255.255.255.0',
-                    'dpdk_port_num': '0',
+                    'dpdk_port_num': 0,
                     'bandwidth': '10 Gbps',
                     'dst_ip': '152.16.100.20',
                     'local_mac': '00:00:00:00:00:01'},
@@ -78,7 +86,7 @@ class TestFixedProfile(unittest.TestCase):
                     'local_ip': '152.16.40.19',
                     'type': 'PCI-PASSTHROUGH',
                     'netmask': '255.255.255.0',
-                    'dpdk_port_num': '1',
+                    'dpdk_port_num': 1,
                     'bandwidth': '10 Gbps',
                     'dst_ip': '152.16.40.20',
                     'local_mac': '00:00:00:00:00:02'},