Use WithScenarios base class instead of load_tests
To support test scenarios, we now override load_tests in the module using them. To support alternate test runners and not needing that, the patch makes the Heat test base class inherit testsceanios.WithScenarios. Change-Id: Ie2435e41c466c0687bb1dd95080dcac7c837aaba
This commit is contained in:
parent
ef8b312df8
commit
091b463e8f
|
@ -19,6 +19,7 @@ import mox
|
|||
import os
|
||||
import sys
|
||||
import time
|
||||
import testscenarios
|
||||
import testtools
|
||||
|
||||
from oslo.config import cfg
|
||||
|
@ -30,7 +31,7 @@ from heat.engine import resources
|
|||
from heat.engine import scheduler
|
||||
|
||||
|
||||
class HeatTestCase(testtools.TestCase):
|
||||
class HeatTestCase(testscenarios.WithScenarios, testtools.TestCase):
|
||||
|
||||
TIME_STEP = 0.1
|
||||
|
||||
|
|
|
@ -21,7 +21,6 @@ import sys
|
|||
import mock
|
||||
import mox
|
||||
from testtools import matchers
|
||||
import testscenarios
|
||||
|
||||
from oslo.config import cfg
|
||||
|
||||
|
@ -50,9 +49,6 @@ from heat.tests import generic_resource as generic_rsrc
|
|||
from heat.tests import utils
|
||||
|
||||
|
||||
load_tests = testscenarios.load_tests_apply_scenarios
|
||||
|
||||
|
||||
wp_template = '''
|
||||
{
|
||||
"AWSTemplateFormatVersion" : "2010-09-09",
|
||||
|
|
|
@ -15,7 +15,6 @@
|
|||
import fixtures
|
||||
import mock
|
||||
import os.path
|
||||
import testscenarios
|
||||
|
||||
from oslo.config import cfg
|
||||
|
||||
|
@ -30,9 +29,6 @@ from heat.tests import generic_resource
|
|||
from heat.tests import common
|
||||
|
||||
|
||||
load_tests = testscenarios.load_tests_apply_scenarios
|
||||
|
||||
|
||||
class EnvironmentTest(common.HeatTestCase):
|
||||
def setUp(self):
|
||||
super(EnvironmentTest, self).setUp()
|
||||
|
|
|
@ -13,16 +13,12 @@
|
|||
# under the License.
|
||||
|
||||
import mock
|
||||
import testscenarios
|
||||
import yaml
|
||||
|
||||
from heat.common import environment_format
|
||||
from heat.tests import common
|
||||
|
||||
|
||||
load_tests = testscenarios.load_tests_apply_scenarios
|
||||
|
||||
|
||||
class YamlEnvironmentTest(common.HeatTestCase):
|
||||
|
||||
def test_minimal_yaml(self):
|
||||
|
|
|
@ -14,15 +14,12 @@
|
|||
# under the License.
|
||||
"""Tests for :module:'heat.engine.resources.nova_utls'."""
|
||||
|
||||
import testscenarios
|
||||
import uuid
|
||||
|
||||
from heat.common import exception
|
||||
from heat.engine.resources import nova_utils
|
||||
from heat.tests.common import HeatTestCase
|
||||
|
||||
load_tests = testscenarios.load_tests_apply_scenarios
|
||||
|
||||
|
||||
class NovaUtilsTests(HeatTestCase):
|
||||
"""
|
||||
|
|
|
@ -15,8 +15,6 @@
|
|||
import json
|
||||
import time
|
||||
|
||||
import testscenarios
|
||||
|
||||
from keystoneclient import exceptions as kc_exceptions
|
||||
|
||||
from oslo.config import cfg
|
||||
|
@ -40,8 +38,6 @@ from heat.tests import generic_resource as generic_rsrc
|
|||
|
||||
import heat.db.api as db_api
|
||||
|
||||
load_tests = testscenarios.load_tests_apply_scenarios
|
||||
|
||||
|
||||
def join(raw):
|
||||
return parser.Template.resolve_joins(raw)
|
||||
|
|
|
@ -21,12 +21,9 @@ from heat.engine.resources.random_string import RandomString
|
|||
from heat.tests.common import HeatTestCase
|
||||
from heat.tests import utils
|
||||
|
||||
import testscenarios
|
||||
from testtools.matchers import MatchesRegex
|
||||
from testtools.matchers import HasLength
|
||||
|
||||
load_tests = testscenarios.load_tests_apply_scenarios
|
||||
|
||||
|
||||
class TestRandomString(HeatTestCase):
|
||||
|
||||
|
|
|
@ -15,8 +15,6 @@
|
|||
import itertools
|
||||
import uuid
|
||||
|
||||
import testscenarios
|
||||
|
||||
from heat.common import exception
|
||||
from heat.engine import dependencies
|
||||
from heat.engine import parser
|
||||
|
@ -32,9 +30,6 @@ from heat.tests.common import HeatTestCase
|
|||
from heat.tests import utils
|
||||
|
||||
|
||||
load_tests = testscenarios.load_tests_apply_scenarios
|
||||
|
||||
|
||||
class ResourceTest(HeatTestCase):
|
||||
def setUp(self):
|
||||
super(ResourceTest, self).setUp()
|
||||
|
|
|
@ -15,7 +15,6 @@
|
|||
import mock
|
||||
import os
|
||||
import testtools
|
||||
import testscenarios
|
||||
import yaml
|
||||
|
||||
from heat.engine import clients
|
||||
|
@ -25,8 +24,6 @@ from heat.common import template_format
|
|||
from heat.tests.common import HeatTestCase
|
||||
from heat.tests import utils
|
||||
|
||||
load_tests = testscenarios.load_tests_apply_scenarios
|
||||
|
||||
|
||||
class JsonToYamlTest(HeatTestCase):
|
||||
|
||||
|
|
|
@ -20,15 +20,12 @@ import datetime
|
|||
import json
|
||||
from oslo.config import cfg
|
||||
import stubout
|
||||
import testscenarios
|
||||
import webob
|
||||
|
||||
from heat.common import exception
|
||||
from heat.common import wsgi
|
||||
from heat.tests.common import HeatTestCase
|
||||
|
||||
load_tests = testscenarios.load_tests_apply_scenarios
|
||||
|
||||
|
||||
class RequestTest(HeatTestCase):
|
||||
|
||||
|
|
Loading…
Reference in New Issue