simplify heat test_limits
the test_limits test has a lot of conventions from other parts
of tempest which are not needed, like the use of setUpClass, and
setting _interface.
To do this we need to assign a client in the base class, further
refactoring should be able to remove a lot of code from these
tests.
This trims this down to the same functional equivalent, but with
less code.
Change-Id: Iabfa9afb7b55c4cdb86c519bce798e548463e7c4
diff --git a/tempest/api/orchestration/base.py b/tempest/api/orchestration/base.py
index 79f8f4a..9bf9568 100644
--- a/tempest/api/orchestration/base.py
+++ b/tempest/api/orchestration/base.py
@@ -36,6 +36,7 @@
cls.os = os
cls.orchestration_client = os.orchestration_client
+ cls.client = os.orchestration_client
cls.servers_client = os.servers_client
cls.keypairs_client = os.keypairs_client
cls.network_client = os.network_client
@@ -73,13 +74,13 @@
def clear_stacks(cls):
for stack_identifier in cls.stacks:
try:
- cls.orchestration_client.delete_stack(stack_identifier)
+ cls.client.delete_stack(stack_identifier)
except exceptions.NotFound:
pass
for stack_identifier in cls.stacks:
try:
- cls.orchestration_client.wait_for_stack_status(
+ cls.client.wait_for_stack_status(
stack_identifier, 'DELETE_COMPLETE')
except exceptions.NotFound:
pass
diff --git a/tempest/api/orchestration/stacks/test_limits.py b/tempest/api/orchestration/stacks/test_limits.py
index 22f544d..893dcc4 100644
--- a/tempest/api/orchestration/stacks/test_limits.py
+++ b/tempest/api/orchestration/stacks/test_limits.py
@@ -24,16 +24,10 @@
class TestServerStackLimits(base.BaseOrchestrationTest):
- _interface = 'json'
-
- @classmethod
- def setUpClass(cls):
- super(TestServerStackLimits, cls).setUpClass()
- cls.client = cls.orchestration_client
- cls.stack_name = data_utils.rand_name('heat')
@attr(type='gate')
def test_exceed_max_template_size_fails(self):
+ stack_name = data_utils.rand_name('heat')
fill = 'A' * CONF.orchestration.max_template_size
template = '''
HeatTemplateFormatVersion: '2012-12-12'
@@ -41,5 +35,5 @@
Outputs:
Foo: bar''' % fill
ex = self.assertRaises(exceptions.BadRequest, self.create_stack,
- self.stack_name, template)
+ stack_name, template)
self.assertIn('Template exceeds maximum allowed size', str(ex))