Added traffic update capability to Ixload TG
[yardstick.git] / yardstick / tests / unit / network_services / traffic_profile / test_http.py
index 0d1b916..874ec37 100644 (file)
 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 # See the License for the specific language governing permissions and
 # limitations under the License.
-#
 
 import unittest
 
-from yardstick.network_services.traffic_profile.base import TrafficProfile
-from yardstick.network_services.traffic_profile.http import \
-    TrafficProfileGenericHTTP
+from yardstick.network_services.traffic_profile import http
 
 
 class TestTrafficProfileGenericHTTP(unittest.TestCase):
+
+    TP_CONFIG = {'traffic_profile': {'duration': 10},
+                 "uplink_0": {}, "downlink_0": {}}
+
     def test___init__(self):
-        traffic_profile_generic_htt_p = \
-            TrafficProfileGenericHTTP(TrafficProfile)
-        self.assertIsNotNone(traffic_profile_generic_htt_p)
+        tp_generic_http = http.TrafficProfileGenericHTTP(
+            self.TP_CONFIG)
+        self.assertIsNotNone(tp_generic_http)
+
+    def test_get_links_param(self):
+        tp_generic_http = http.TrafficProfileGenericHTTP(
+            self.TP_CONFIG)
+
+        links = tp_generic_http.get_links_param()
+        self.assertEqual({"uplink_0": {}, "downlink_0": {}}, links)
 
     def test_execute(self):
-        traffic_profile_generic_htt_p = \
-            TrafficProfileGenericHTTP(TrafficProfile)
+        tp_generic_http = http.TrafficProfileGenericHTTP(
+            self.TP_CONFIG)
         traffic_generator = {}
-        self.assertIsNone(
-            traffic_profile_generic_htt_p.execute(traffic_generator))
+        self.assertIsNone(tp_generic_http.execute(traffic_generator))
 
     def test__send_http_request(self):
-        traffic_profile_generic_htt_p = \
-                TrafficProfileGenericHTTP(TrafficProfile)
-        self.assertIsNone(traffic_profile_generic_htt_p._send_http_request(
-                             "10.1.1.1", "250", "/req"))
+        tp_generic_http = http.TrafficProfileGenericHTTP(
+            self.TP_CONFIG)
+        self.assertIsNone(tp_generic_http._send_http_request(
+            '10.1.1.1', '250', '/req'))