From 0eff62a0bdbdf3d78a03cb9fa90bbb96e8bb6f7d Mon Sep 17 00:00:00 2001 From: Rodolfo Alonso Hernandez Date: Fri, 29 Jun 2018 11:29:34 +0100 Subject: Cleanup TestProxBinSearchProfile unit tests Removed unneeded output and mocks. JIRA: YARDSTICK-1266 Change-Id: I04fd1ba32ea46c7896548faebc5af1a43b0f750e Signed-off-by: Rodolfo Alonso Hernandez --- .../traffic_profile/test_prox_binsearch.py | 26 +++++++++++----------- 1 file 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 -- cgit 1.2.3-korg