diff options
Diffstat (limited to 'tests/unit/network_services/vnf_generic/vnf/test_tg_rfc2544_ixia.py')
-rw-r--r-- | tests/unit/network_services/vnf_generic/vnf/test_tg_rfc2544_ixia.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/tests/unit/network_services/vnf_generic/vnf/test_tg_rfc2544_ixia.py b/tests/unit/network_services/vnf_generic/vnf/test_tg_rfc2544_ixia.py index e9f718cb7..61fc012bc 100644 --- a/tests/unit/network_services/vnf_generic/vnf/test_tg_rfc2544_ixia.py +++ b/tests/unit/network_services/vnf_generic/vnf/test_tg_rfc2544_ixia.py @@ -1,5 +1,3 @@ -#!/usr/bin/env python - # Copyright (c) 2016-2017 Intel Corporation # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -16,8 +14,10 @@ # import os -import unittest + import mock +import six +import unittest from tests.unit import STL_MOCKS @@ -170,7 +170,7 @@ class TestIXIATrafficGen(unittest.TestCase): ssh.from_node.return_value = ssh_mock vnfd = self.VNFD['vnfd:vnfd-catalog']['vnfd'][0] ixnet_traffic_gen = IxiaTrafficGen(NAME, vnfd) - self.assertEqual(None, ixnet_traffic_gen.listen_traffic({})) + self.assertIsNone(ixnet_traffic_gen.listen_traffic({})) def test_instantiate(self, *args): with mock.patch("yardstick.ssh.SSH") as ssh: @@ -228,7 +228,7 @@ class TestIXIATrafficGen(unittest.TestCase): ixnet_traffic_gen._ixia_traffic_gen.ix_stop_traffic = mock.Mock() ixnet_traffic_gen._traffic_process = mock.MagicMock() ixnet_traffic_gen._traffic_process.terminate = mock.Mock() - self.assertEqual(None, ixnet_traffic_gen.terminate()) + self.assertIsNone(ixnet_traffic_gen.terminate()) def _get_file_abspath(self, filename): curr_path = os.path.dirname(os.path.abspath(__file__)) @@ -341,7 +341,7 @@ class TestIXIATrafficGen(unittest.TestCase): 'task_path': '/path/to/task' } - @mock.patch('yardstick.benchmark.scenarios.networking.vnf_generic.open', create=True) + @mock.patch.object(six.moves.builtins, 'open', create=True) @mock.patch('yardstick.network_services.vnf_generic.vnf.tg_rfc2544_ixia.open', mock.mock_open(), create=True) @mock.patch('yardstick.network_services.vnf_generic.vnf.tg_rfc2544_ixia.LOG.exception') |