Fix compute_unified decoration
Current test class decorate the class with skip. The problem is that when feature is disabled the skip section returns a function type. The ServersQuotaTest class inherits from a function type instead type (class) and it fails with TypeError: function() argument We dont see the exception because on false we dont try to run testtool version is 2.5.0 Change-Id: I3ff2e59ca1eaae4f9b1eb1fb7148cd3efcbcd8f2
This commit is contained in:
parent
5c556626d1
commit
a814961796
|
@ -13,8 +13,6 @@
|
|||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
import testtools
|
||||
|
||||
from tempest.common import utils
|
||||
from tempest.common import waiters
|
||||
from tempest import config
|
||||
|
@ -25,8 +23,6 @@ from tempest.scenario import manager
|
|||
CONF = config.CONF
|
||||
|
||||
|
||||
@testtools.skipUnless(CONF.compute_feature_enabled.unified_limits,
|
||||
'Compute unified limits are not enabled')
|
||||
class ComputeProjectQuotaTest(manager.ScenarioTest):
|
||||
"""The test base class for compute unified limits tests.
|
||||
|
||||
|
@ -40,6 +36,12 @@ class ComputeProjectQuotaTest(manager.ScenarioTest):
|
|||
credentials = ['primary', 'system_admin']
|
||||
force_tenant_isolation = True
|
||||
|
||||
@classmethod
|
||||
def skip_checks(cls):
|
||||
super(ComputeProjectQuotaTest, cls).skip_checks()
|
||||
if not CONF.compute_feature_enabled.unified_limits:
|
||||
raise cls.skipException('Compute unified limits are not enabled.')
|
||||
|
||||
@classmethod
|
||||
def resource_setup(cls):
|
||||
super(ComputeProjectQuotaTest, cls).resource_setup()
|
||||
|
@ -67,8 +69,6 @@ class ComputeProjectQuotaTest(manager.ScenarioTest):
|
|||
self.limit_ids[name], value)
|
||||
|
||||
|
||||
@testtools.skipUnless(CONF.compute_feature_enabled.unified_limits,
|
||||
'Compute unified limits are not enabled')
|
||||
class ServersQuotaTest(ComputeProjectQuotaTest):
|
||||
|
||||
@classmethod
|
||||
|
|
Loading…
Reference in New Issue