Merge "Improve SampleVNF hugepages setup"
[yardstick.git] / tests / unit / network_services / traffic_profile / test_http.py
1 #!/usr/bin/env python
2
3 # Copyright (c) 2016-2017 Intel Corporation
4 #
5 # Licensed under the Apache License, Version 2.0 (the "License");
6 # you may not use this file except in compliance with the License.
7 # You may obtain a copy of the License at
8 #
9 #      http://www.apache.org/licenses/LICENSE-2.0
10 #
11 # Unless required by applicable law or agreed to in writing, software
12 # distributed under the License is distributed on an "AS IS" BASIS,
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 # See the License for the specific language governing permissions and
15 # limitations under the License.
16 #
17
18 from __future__ import absolute_import
19 import unittest
20
21 from yardstick.network_services.traffic_profile.base import TrafficProfile
22 from yardstick.network_services.traffic_profile.http import \
23     TrafficProfileGenericHTTP
24
25
26 class TestTrafficProfileGenericHTTP(unittest.TestCase):
27     def test___init__(self):
28         traffic_profile_generic_htt_p = \
29             TrafficProfileGenericHTTP(TrafficProfile)
30         self.assertIsNotNone(traffic_profile_generic_htt_p)
31
32     def test_execute(self):
33         traffic_profile_generic_htt_p = \
34                 TrafficProfileGenericHTTP(TrafficProfile)
35         traffic_generator = {}
36         self.assertEqual(None,
37                          traffic_profile_generic_htt_p.execute(
38                              traffic_generator))
39
40     def test__send_http_request(self):
41         traffic_profile_generic_htt_p = \
42                 TrafficProfileGenericHTTP(TrafficProfile)
43         self.assertEqual(None,
44                          traffic_profile_generic_htt_p._send_http_request(
45                              "10.1.1.1", "250", "/req"))