Relocate iniparser to yardstick.network_services.helpers 47/45047/1
authorEdward MacGillivray <edward.s.macgillivray@intel.com>
Fri, 13 Oct 2017 21:01:39 +0000 (14:01 -0700)
committerEdward MacGillivray <edward.s.macgillivray@intel.com>
Fri, 13 Oct 2017 21:07:05 +0000 (14:07 -0700)
Change-Id: I1f457c9c24f2ca84dde61b64f58edaff8952670a
Signed-off-by: Edward MacGillivray <edward.s.macgillivray@intel.com>
tests/unit/network_services/helpers/test_iniparser.py [moved from tests/unit/network_services/vnf_generic/vnf/test_iniparser.py with 91% similarity]
tests/unit/network_services/vnf_generic/vnf/test_prox_vnf.py
yardstick/network_services/helpers/iniparser.py [moved from yardstick/network_services/vnf_generic/vnf/iniparser.py with 100% similarity]
yardstick/network_services/vnf_generic/vnf/prox_helpers.py

@@ -27,10 +27,10 @@ stl_patch = mock.patch.dict("sys.modules", STL_MOCKS)
 stl_patch.start()
 
 if stl_patch:
-    from yardstick.network_services.vnf_generic.vnf.iniparser import ParseError
-    from yardstick.network_services.vnf_generic.vnf.iniparser import LineParser
-    from yardstick.network_services.vnf_generic.vnf.iniparser import BaseParser
-    from yardstick.network_services.vnf_generic.vnf.iniparser import ConfigParser
+    from yardstick.network_services.helpers.iniparser import ParseError
+    from yardstick.network_services.helpers.iniparser import LineParser
+    from yardstick.network_services.helpers.iniparser import BaseParser
+    from yardstick.network_services.helpers.iniparser import ConfigParser
 
 PARSE_TEXT_1 = """\
 
@@ -141,7 +141,7 @@ class TestConfigParser(unittest.TestCase):
 
         return internal_open
 
-    @mock.patch('yardstick.network_services.vnf_generic.vnf.iniparser.open')
+    @mock.patch('yardstick.network_services.helpers.iniparser.open')
     def test_parse(self, mock_open):
         mock_open.side_effect = self.make_open(PARSE_TEXT_1)
 
@@ -182,7 +182,7 @@ class TestConfigParser(unittest.TestCase):
         self.assertEqual(config_parser.find_section_index('section1'), 1)
         self.assertEqual(config_parser.find_section_index('section3'), -1)
 
-    @mock.patch('yardstick.network_services.vnf_generic.vnf.iniparser.open')
+    @mock.patch('yardstick.network_services.helpers.iniparser.open')
     def test_parse_2(self, mock_open):
         mock_open.side_effect = self.make_open(PARSE_TEXT_2)
 
@@ -200,7 +200,7 @@ class TestConfigParser(unittest.TestCase):
 
         self.assertEqual(config_parser.sections, expected)
 
-    @mock.patch('yardstick.network_services.vnf_generic.vnf.iniparser.open')
+    @mock.patch('yardstick.network_services.helpers.iniparser.open')
     def test_parse_negative(self, mock_open):
         bad_text_dict = {
             'no section': PARSE_TEXT_BAD_1,
index 09060ff..a6d4087 100644 (file)
@@ -376,7 +376,7 @@ class TestProxApproxVnf(unittest.TestCase):
         return file_path
 
     @mock.patch('yardstick.benchmark.scenarios.networking.vnf_generic.open', create=True)
-    @mock.patch('yardstick.network_services.vnf_generic.vnf.iniparser.open', create=True)
+    @mock.patch('yardstick.network_services.helpers.iniparser.open', create=True)
     @mock.patch(SSH_HELPER)
     def test_run_prox(self, ssh, *_):
         mock_ssh(ssh)
index 992b6d0..ac5abfb 100644 (file)
 from __future__ import absolute_import
 
 import array
-import operator
-import logging
 import io
+import logging
+import operator
 import os
 import re
 import select
 import socket
-
-from collections import OrderedDict, namedtuple
 import time
+from collections import OrderedDict, namedtuple
 from contextlib import contextmanager
 from itertools import repeat, chain
 from multiprocessing import Queue
 
 import six
-from six.moves import zip, StringIO
 from six.moves import cStringIO
+from six.moves import zip, StringIO
 
 from yardstick.benchmark.scenarios.networking.vnf_generic import find_relative_file
 from yardstick.common import utils
 from yardstick.common.utils import SocketTopology, join_non_strings, try_int
-from yardstick.network_services.vnf_generic.vnf.iniparser import ConfigParser
+from yardstick.network_services.helpers.iniparser import ConfigParser
 from yardstick.network_services.vnf_generic.vnf.sample_vnf import ClientResourceHelper
 from yardstick.network_services.vnf_generic.vnf.sample_vnf import DpdkVnfSetupEnvHelper