# limitations under the License.
 #
 
-from __future__ import absolute_import
-
-import unittest
 import mock
+import unittest
 
-from tests.unit import STL_MOCKS
+from yardstick.tests import STL_MOCKS
 
 STLClient = mock.MagicMock()
 stl_patch = mock.patch.dict("sys.modules", STL_MOCKS)
 
 # limitations under the License.
 #
 
-from __future__ import absolute_import
 import unittest
 
 from yardstick.network_services.traffic_profile.base import TrafficProfile
 
     def test_execute(self):
         traffic_profile_generic_htt_p = \
-                TrafficProfileGenericHTTP(TrafficProfile)
+            TrafficProfileGenericHTTP(TrafficProfile)
         traffic_generator = {}
         self.assertIsNone(
             traffic_profile_generic_htt_p.execute(traffic_generator))
 
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-
-from __future__ import absolute_import
 import unittest
 import mock
 
         with self.assertRaises(Exception):
             ixload.load_config_file("ixload.cfg")
 
-    @mock.patch('yardstick.network_services.traffic_profile.http_ixload.IxLoad')
     @mock.patch('yardstick.network_services.traffic_profile.http_ixload.StatCollectorUtils')
-    def test_start_http_test_connect_error(self, mock_collector_type, mock_ixload_type):
+    @mock.patch('yardstick.network_services.traffic_profile.http_ixload.IxLoad')
+    def test_start_http_test_connect_error(self, mock_ixload_type, *args):
         ports = [1, 2, 3]
         test_input = {
             "remote_server": "REMOTE_SERVER",
 
         j = jsonutils.dump_as_bytes(test_input)
 
-        mock_ixload = mock_ixload_type()
-        mock_ixload.connect.side_effect = RuntimeError
+        mock_ixload_type.return_value.connect.side_effect = RuntimeError
 
         ixload = http_ixload.IXLOADHttpTest(j)
         ixload.results_on_windows = 'windows_result_dir'
 
     @mock.patch('yardstick.network_services.traffic_profile.http_ixload.IxLoad')
     @mock.patch('yardstick.network_services.traffic_profile.http_ixload.StatCollectorUtils')
-    def test_start_http_test(self, mock_collector_type, mock_ixload_type):
+    def test_start_http_test(self, *args):
         ports = [1, 2, 3]
         test_input = {
             "remote_server": "REMOTE_SERVER",
 
     @mock.patch('yardstick.network_services.traffic_profile.http_ixload.IxLoad')
     @mock.patch('yardstick.network_services.traffic_profile.http_ixload.StatCollectorUtils')
-    def test_start_http_test_reassign_error(self, mock_collector_type, mock_ixload_type):
+    def test_start_http_test_reassign_error(self, *args):
         ports = [1, 2, 3]
         test_input = {
             "remote_server": "REMOTE_SERVER",
         ixload.result_dir = 'my_result_dir'
 
         ixload.start_http_test()
-        self.assertEqual(reassign_ports.call_count, 1)
+        reassign_ports.assert_called_once()
 
     @mock.patch("yardstick.network_services.traffic_profile.http_ixload.IXLOADHttpTest")
-    def test_main(self, IXLOADHttpTest):
+    def test_main(self, *args):
         args = ["1", "2", "3"]
         http_ixload.main(args)
 
 # limitations under the License.
 #
 
-from __future__ import absolute_import
-from __future__ import division
 import unittest
 import mock
 
 from copy import deepcopy
 
-from tests.unit import STL_MOCKS
+from yardstick.tests import STL_MOCKS
 
 STLClient = mock.MagicMock()
 stl_patch = mock.patch.dict("sys.modules", STL_MOCKS)
         },
     }
 
-    PROFILE = {'description': 'Traffic profile to run RFC2544 latency',
-               'name': 'rfc2544',
-               'traffic_profile': {'traffic_type': 'IXIARFC2544Profile',
-                                   'frame_rate': 100},
-               IXIARFC2544Profile.DOWNLINK: {'ipv4':
-                          {'outer_l2': {'framesize':
-                                        {'64B': '100', '1518B': '0',
-                                         '128B': '0', '1400B': '0',
-                                         '256B': '0', '373b': '0',
-                                         '570B': '0'}},
-                           'outer_l3v4': {'dstip4': '1.1.1.1-1.15.255.255',
-                                          'proto': 'udp', 'count': '1',
-                                          'srcip4': '90.90.1.1-90.105.255.255',
-                                          'dscp': 0, 'ttl': 32},
-                           'outer_l4': {'srcport': '2001',
-                                        'dsrport': '1234'}}},
-               IXIARFC2544Profile.UPLINK: {'ipv4':
-                           {'outer_l2': {'framesize':
-                                         {'64B': '100', '1518B': '0',
-                                          '128B': '0', '1400B': '0',
-                                          '256B': '0', '373b': '0',
-                                          '570B': '0'}},
-                            'outer_l3v4': {'dstip4': '9.9.1.1-90.105.255.255',
-                                           'proto': 'udp', 'count': '1',
-                                           'srcip4': '1.1.1.1-1.15.255.255',
-                                           'dscp': 0, 'ttl': 32},
-                            'outer_l4': {'dstport': '2001',
-                                         'srcport': '1234'}}},
-               'schema': 'isb:traffic_profile:0.1'}
+    PROFILE = {
+        'description': 'Traffic profile to run RFC2544 latency',
+        'name': 'rfc2544',
+        'traffic_profile': {
+            'traffic_type': 'IXIARFC2544Profile',
+            'frame_rate': 100},
+        IXIARFC2544Profile.DOWNLINK: {
+            'ipv4': {
+                'outer_l2': {
+                    'framesize': {
+                        '64B': '100',
+                        '1518B': '0',
+                        '128B': '0',
+                        '1400B': '0',
+                        '256B': '0',
+                        '373b': '0',
+                        '570B': '0'}},
+                'outer_l3v4': {
+                    'dstip4': '1.1.1.1-1.15.255.255',
+                    'proto': 'udp',
+                    'count': '1',
+                    'srcip4': '90.90.1.1-90.105.255.255',
+                    'dscp': 0,
+                    'ttl': 32},
+                'outer_l4': {
+                    'srcport': '2001',
+                    'dsrport': '1234'}}},
+        IXIARFC2544Profile.UPLINK: {
+            'ipv4': {
+                'outer_l2': {
+                    'framesize': {
+                        '64B': '100',
+                        '1518B': '0',
+                        '128B': '0',
+                        '1400B': '0',
+                        '256B': '0',
+                        '373b': '0',
+                        '570B': '0'}},
+                'outer_l3v4': {
+                    'dstip4': '9.9.1.1-90.105.255.255',
+                    'proto': 'udp',
+                    'count': '1',
+                    'srcip4': '1.1.1.1-1.15.255.255',
+                    'dscp': 0,
+                    'ttl': 32},
+                'outer_l4': {
+                    'dstport': '2001',
+                    'srcport': '1234'}}},
+        'schema': 'isb:traffic_profile:0.1'}
 
     def test_get_ixia_traffic_profile_error(self):
         traffic_generator = mock.Mock(autospec=TrexProfile)
                     "count": "1"
                 },
                 "outer_l3v6": {
-                    "count": 1024,
                     "dscp": 0,
                     "dstip4": "152.16.100.20",
                     "proto": "udp",
                     "ttl": 32
                 },
                 "outer_l3v4": {
-                    "count": 1024,
                     "dscp": 0,
                     "dstip4": "152.16.100.20",
                     "proto": "udp",
                     "ttl": 32,
                 },
                 "outer_l3v6": {
-                    "count": 1024,
                     "dscp": 0,
                     "dstip4": "152.16.100.20",
                     "proto": "udp",
                           'outer_l4': {'srcport': '2001',
                                        'dsrport': '1234'}}},
                         IXIARFC2544Profile.UPLINK: {'ipv4':
-                                    {'outer_l2': {'framesize':
-                                                  {'64B': '100', '1518B': '0',
-                                                   '128B': '0', '1400B': '0',
-                                                   '256B': '0', '373b': '0',
-                                                   '570B': '0'}},
-                                     'outer_l3v4':
-                                     {'dstip4': '9.9.1.1-90.105.255.255',
-                                      'proto': 'udp', 'count': '1',
-                                      'srcip4': '1.1.1.1-1.15.255.255',
-                                      'dscp': 0, 'ttl': 32},
-                                     'outer_l3v6':
-                                     {'dstip6': '9.9.1.1-90.105.255.255',
-                                      'proto': 'udp', 'count': '1',
-                                      'srcip6': '1.1.1.1-1.15.255.255',
-                                      'dscp': 0, 'ttl': 32},
+                                                    {'outer_l2': {'framesize':
+                                                                  {'64B': '100', '1518B': '0',
+                                                                   '128B': '0', '1400B': '0',
+                                                                   '256B': '0', '373b': '0',
+                                                                   '570B': '0'}},
+                                                        'outer_l3v4':
+                                                        {'dstip4': '9.9.1.1-90.105.255.255',
+                                                         'proto': 'udp', 'count': '1',
+                                                         'srcip4': '1.1.1.1-1.15.255.255',
+                                                         'dscp': 0, 'ttl': 32},
+                                                        'outer_l3v6':
+                                                        {'dstip6': '9.9.1.1-90.105.255.255',
+                                                         'proto': 'udp', 'count': '1',
+                                                         'srcip6': '1.1.1.1-1.15.255.255',
+                                                         'dscp': 0, 'ttl': 32},
 
-                                     'outer_l4': {'dstport': '2001',
-                                                  'srcport': '1234'}}},
+                                                        'outer_l4': {'dstport': '2001',
+                                                                     'srcport': '1234'}}},
                         'schema': 'isb:traffic_profile:0.1'}
         result = r_f_c2544_profile._get_ixia_traffic_profile(profile_data, mac)
         self.assertIsNotNone(result)
         r_f_c2544_profile.full_profile = {}
         r_f_c2544_profile.get_streams = mock.Mock()
 
-        self.assertIsNone(r_f_c2544_profile.update_traffic_profile(traffic_generator))
+        self.assertIsNone(
+            r_f_c2544_profile.update_traffic_profile(traffic_generator))
         self.assertEqual(r_f_c2544_profile.ports, ports_expected)
 
     def test_get_drop_percentage(self):
 
 # limitations under the License.
 #
 
-from __future__ import absolute_import
-
 import unittest
 import mock
 
-from tests.unit import STL_MOCKS
+from yardstick.tests import STL_MOCKS
 
 STLClient = mock.MagicMock()
 stl_patch = mock.patch.dict("sys.modules", STL_MOCKS)
 class TestProxACLProfile(unittest.TestCase):
 
     def test_run_test_with_pkt_size(self):
-        def target(*args, **kwargs):
+        def target(*args):
             runs.append(args[2])
             if args[2] < 0 or args[2] > 100:
                 raise RuntimeError(' '.join([str(args), str(runs)]))
                 return fail_tuple, {}
             return success_tuple, {}
 
-        def get_mock_samples(*args, **kwargs):
-            if args[2] < 0:
-                raise RuntimeError(' '.join([str(args), str(runs)]))
-            return success_tuple
-
         tp_config = {
-           'traffic_profile': {
+            'traffic_profile': {
                 'upper_bound': 100.0,
                 'lower_bound': 0.0,
                 'tolerated_loss': 50.0,
         }
 
         runs = []
-        success_tuple = ProxTestDataTuple(10.0, 1, 2, 3, 4, [5.1, 5.2, 5.3], 995, 1000, 123.4)
-        fail_tuple = ProxTestDataTuple(10.0, 1, 2, 3, 4, [5.6, 5.7, 5.8], 850, 1000, 123.4)
+        success_tuple = ProxTestDataTuple(
+            10.0, 1, 2, 3, 4, [5.1, 5.2, 5.3], 995, 1000, 123.4)
+        fail_tuple = ProxTestDataTuple(
+            10.0, 1, 2, 3, 4, [5.6, 5.7, 5.8], 850, 1000, 123.4)
 
         traffic_gen = mock.MagicMock()
 
         profile.tolerated_loss = 100.0
         profile._profile_helper = profile_helper
 
-        profile.run_test_with_pkt_size(traffic_gen, profile.pkt_size, profile.duration)
+        profile.run_test_with_pkt_size(
+            traffic_gen, profile.pkt_size, profile.duration)
 
 # limitations under the License.
 #
 
-from __future__ import absolute_import
-
 import unittest
 import mock
 
-from tests.unit import STL_MOCKS
+from yardstick.tests import STL_MOCKS
 
 STLClient = mock.MagicMock()
 stl_patch = mock.patch.dict("sys.modules", STL_MOCKS)
 
 # limitations under the License.
 #
 
-from __future__ import absolute_import
-
 import unittest
 import mock
 
-from tests.unit import STL_MOCKS
+from yardstick.tests import STL_MOCKS
 
 STLClient = mock.MagicMock()
 stl_patch = mock.patch.dict("sys.modules", STL_MOCKS)
 
 # limitations under the License.
 #
 
-from __future__ import absolute_import
-
 import unittest
 import mock
 
-from tests.unit import STL_MOCKS
+from yardstick.tests import STL_MOCKS
 
 STLClient = mock.MagicMock()
 stl_patch = mock.patch.dict("sys.modules", STL_MOCKS)
 
 import unittest
 import mock
 
-from tests.unit import STL_MOCKS
+from yardstick.tests import STL_MOCKS
 
 
 STLClient = mock.MagicMock()
             mock.Mock(return_value=True)
         r_f_c2544_profile = RFC2544Profile(self.TRAFFIC_PROFILE)
         r_f_c2544_profile.params = self.PROFILE
-        self.assertIsNone(r_f_c2544_profile.execute_traffic(traffic_generator))
+        self.assertIsNone(
+            r_f_c2544_profile.execute_traffic(traffic_generator))
         samples = {}
         for ifname in range(1):
             name = "xe{}".format(ifname)
 
 import six
 import unittest
 
-from tests.unit import STL_MOCKS
+from yardstick.tests import STL_MOCKS
 from yardstick.common import exceptions as y_exc
 
 STLClient = mock.MagicMock()