From 619bed631f064a94ab20ac296802d467ebe32318 Mon Sep 17 00:00:00 2001 From: Rodolfo Alonso Hernandez Date: Fri, 1 Jun 2018 09:38:28 +0100 Subject: Remove __init__ method overriding in HeatContextTestCase Unit test case clases should implement setUp() method instead of overriding __init__() method. JIRA: YARDSTICK-1210 Change-Id: I0f9a10575f9aeebf76dfa84619e59589b3ea83f6 Signed-off-by: Rodolfo Alonso Hernandez --- yardstick/tests/unit/benchmark/contexts/test_heat.py | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/yardstick/tests/unit/benchmark/contexts/test_heat.py b/yardstick/tests/unit/benchmark/contexts/test_heat.py index ebb1d69ba..947e6fe22 100644 --- a/yardstick/tests/unit/benchmark/contexts/test_heat.py +++ b/yardstick/tests/unit/benchmark/contexts/test_heat.py @@ -13,29 +13,26 @@ import logging import os import mock -import unittest +from yardstick import ssh from yardstick.benchmark.contexts import base from yardstick.benchmark.contexts import heat from yardstick.benchmark.contexts import model from yardstick.common import constants as consts from yardstick.common import exceptions as y_exc -from yardstick import ssh +from yardstick.tests.unit import base as ut_base LOG = logging.getLogger(__name__) -class HeatContextTestCase(unittest.TestCase): - - def __init__(self, *args, **kwargs): - super(HeatContextTestCase, self).__init__(*args, **kwargs) - self.name_iter = ('vnf{:03}'.format(x) for x in count(0, step=3)) +class HeatContextTestCase(ut_base.BaseUnitTestCase): def setUp(self): self.test_context = heat.HeatContext() self.addCleanup(self._remove_contexts) self.mock_context = mock.Mock(spec=heat.HeatContext()) + self.name_iter = ('vnf{:03}'.format(x) for x in count(0, step=3)) def _remove_contexts(self): if self.test_context in self.test_context.list: -- cgit 1.2.3-korg