aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRodolfo Alonso Hernandez <rodolfo.alonso.hernandez@intel.com>2018-06-29 11:29:34 +0100
committerRodolfo Alonso Hernandez <rodolfo.alonso.hernandez@intel.com>2018-06-29 15:17:16 +0000
commit0eff62a0bdbdf3d78a03cb9fa90bbb96e8bb6f7d (patch)
tree49cae5e647eb7f29fa67afa9bece331eff1310e3
parent005358a39a87e42061dd5b344916c2ffe0475961 (diff)
Cleanup TestProxBinSearchProfile unit tests
Removed unneeded output and mocks. JIRA: YARDSTICK-1266 Change-Id: I04fd1ba32ea46c7896548faebc5af1a43b0f750e Signed-off-by: Rodolfo Alonso Hernandez <rodolfo.alonso.hernandez@intel.com>
-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