summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRodolfo Alonso Hernandez <rodolfo.alonso.hernandez@intel.com>2018-07-02 10:01:25 +0000
committerGerrit Code Review <gerrit@opnfv.org>2018-07-02 10:01:25 +0000
commit500cb610a59123be519e100681cc02af21f596f2 (patch)
tree07b0d92d36d62cbe141eba8e2ecbb41b93838e4c
parentea03d2f78aacd638e4795c26eee7aa233ccfe92e (diff)
parent0eff62a0bdbdf3d78a03cb9fa90bbb96e8bb6f7d (diff)
Merge "Cleanup TestProxBinSearchProfile unit tests"
-rw-r--r--yardstick/tests/unit/network_services/traffic_profile/test_prox_binsearch.py26
1 files changed, 13 insertions, 13 deletions
diff --git a/yardstick/tests/unit/network_services/traffic_profile/test_prox_binsearch.py b/yardstick/tests/unit/network_services/traffic_profile/test_prox_binsearch.py
index 036746e6b..c062308e8 100644
--- a/yardstick/tests/unit/network_services/traffic_profile/test_prox_binsearch.py
+++ b/yardstick/tests/unit/network_services/traffic_profile/test_prox_binsearch.py
@@ -11,23 +11,23 @@
# 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
import mock
-from yardstick.tests import STL_MOCKS
+from yardstick.network_services.vnf_generic.vnf.prox_helpers import ProxTestDataTuple
+from yardstick.network_services.traffic_profile import prox_binsearch
-STLClient = mock.MagicMock()
-stl_patch = mock.patch.dict("sys.modules", STL_MOCKS)
-stl_patch.start()
-if stl_patch:
- from yardstick.network_services.vnf_generic.vnf.prox_helpers import ProxTestDataTuple
- from yardstick.network_services.traffic_profile.prox_binsearch import ProxBinSearchProfile
+class TestProxBinSearchProfile(unittest.TestCase):
+ def setUp(self):
+ self._mock_log_info = mock.patch.object(prox_binsearch.LOG, 'info')
+ self.mock_log_info = self._mock_log_info.start()
+ self.addCleanup(self._stop_mocks)
-class TestProxBinSearchProfile(unittest.TestCase):
+ def _stop_mocks(self):
+ self._mock_log_info.stop()
def test_execute_1(self):
def target(*args, **_):
@@ -60,7 +60,7 @@ class TestProxBinSearchProfile(unittest.TestCase):
profile_helper = mock.MagicMock()
profile_helper.run_test = target
- profile = ProxBinSearchProfile(tp_config)
+ profile = prox_binsearch.ProxBinSearchProfile(tp_config)
profile.init(mock.MagicMock())
profile._profile_helper = profile_helper
@@ -138,7 +138,7 @@ class TestProxBinSearchProfile(unittest.TestCase):
profile_helper = mock.MagicMock()
profile_helper.run_test = target
- profile = ProxBinSearchProfile(tp_config)
+ profile = prox_binsearch.ProxBinSearchProfile(tp_config)
profile.init(mock.MagicMock())
profile._profile_helper = profile_helper
@@ -173,7 +173,7 @@ class TestProxBinSearchProfile(unittest.TestCase):
profile_helper = mock.MagicMock()
profile_helper.run_test = target
- profile = ProxBinSearchProfile(tp_config)
+ profile = prox_binsearch.ProxBinSearchProfile(tp_config)
profile.init(mock.MagicMock())
profile._profile_helper = profile_helper
@@ -227,7 +227,7 @@ class TestProxBinSearchProfile(unittest.TestCase):
profile_helper = mock.MagicMock()
profile_helper.run_test = target
- profile = ProxBinSearchProfile(tp_config)
+ profile = prox_binsearch.ProxBinSearchProfile(tp_config)
profile.init(mock.MagicMock())
profile._profile_helper = profile_helper