Merge "IXIA IxNetwork TP first rate is not populated"
[yardstick.git] / yardstick / tests / unit / network_services / traffic_profile / test_base.py
index 641064c..55276af 100644 (file)
@@ -69,5 +69,20 @@ class TestTrafficProfile(unittest.TestCase):
 
 class TestDummyProfile(unittest.TestCase):
     def test_execute(self):
-        dummy_profile = base.DummyProfile(base.TrafficProfile)
+        tp_config = {'traffic_profile': {'duration': 15}}
+        dummy_profile = base.DummyProfile(tp_config)
         self.assertIsNone(dummy_profile.execute({}))
+
+
+class TrafficProfileConfigTestCase(unittest.TestCase):
+
+    def test__init(self):
+        tp_config = {'traffic_profile': {'packet_sizes': {'64B': 100}}}
+        tp_config_obj = base.TrafficProfileConfig(tp_config)
+        self.assertEqual({'64B': 100}, tp_config_obj.packet_sizes)
+        self.assertEqual(base.TrafficProfileConfig.DEFAULT_SCHEMA,
+                         tp_config_obj.schema)
+        self.assertEqual(base.TrafficProfileConfig.DEFAULT_FRAME_RATE,
+                         tp_config_obj.frame_rate)
+        self.assertEqual(base.TrafficProfileConfig.DEFAULT_DURATION,
+                         tp_config_obj.duration)