Merge "Move all api tests to /tests/api"
This commit is contained in:
commit
347a0b55e4
0
heat/tests/api/__init__.py
Normal file
0
heat/tests/api/__init__.py
Normal file
0
heat/tests/api/aws/__init__.py
Normal file
0
heat/tests/api/aws/__init__.py
Normal file
0
heat/tests/api/cfn/__init__.py
Normal file
0
heat/tests/api/cfn/__init__.py
Normal file
@ -29,7 +29,7 @@ from heat.rpc import client as rpc_client
|
|||||||
from heat.tests import common
|
from heat.tests import common
|
||||||
from heat.tests import utils
|
from heat.tests import utils
|
||||||
|
|
||||||
policy_path = os.path.dirname(os.path.realpath(__file__)) + "/policy/"
|
policy_path = os.path.dirname(os.path.realpath(__file__)) + "/../../policy/"
|
||||||
|
|
||||||
|
|
||||||
class CfnStackControllerTest(common.HeatTestCase):
|
class CfnStackControllerTest(common.HeatTestCase):
|
||||||
@ -41,12 +41,12 @@ class CfnStackControllerTest(common.HeatTestCase):
|
|||||||
def setUp(self):
|
def setUp(self):
|
||||||
super(CfnStackControllerTest, self).setUp()
|
super(CfnStackControllerTest, self).setUp()
|
||||||
|
|
||||||
opts = [
|
self.opts = [
|
||||||
cfg.StrOpt('config_dir', default=policy_path),
|
cfg.StrOpt('config_dir', default=policy_path),
|
||||||
cfg.StrOpt('config_file', default='foo'),
|
cfg.StrOpt('config_file', default='foo'),
|
||||||
cfg.StrOpt('project', default='heat'),
|
cfg.StrOpt('project', default='heat'),
|
||||||
]
|
]
|
||||||
cfg.CONF.register_opts(opts)
|
cfg.CONF.register_opts(self.opts)
|
||||||
cfg.CONF.set_default('host', 'host')
|
cfg.CONF.set_default('host', 'host')
|
||||||
self.topic = rpc_api.ENGINE_TOPIC
|
self.topic = rpc_api.ENGINE_TOPIC
|
||||||
self.api_version = '1.0'
|
self.api_version = '1.0'
|
||||||
@ -62,6 +62,10 @@ class CfnStackControllerTest(common.HeatTestCase):
|
|||||||
'deny_stack_user.json')
|
'deny_stack_user.json')
|
||||||
self.addCleanup(self.m.VerifyAll)
|
self.addCleanup(self.m.VerifyAll)
|
||||||
|
|
||||||
|
def tearDown(self):
|
||||||
|
super(CfnStackControllerTest, self).tearDown()
|
||||||
|
cfg.CONF.unregister_opts(self.opts)
|
||||||
|
|
||||||
def _dummy_GET_request(self, params=None):
|
def _dummy_GET_request(self, params=None):
|
||||||
# Mangle the params dict into a query string
|
# Mangle the params dict into a query string
|
||||||
params = params or {}
|
params = params or {}
|
0
heat/tests/api/cloudwatch/__init__.py
Normal file
0
heat/tests/api/cloudwatch/__init__.py
Normal file
@ -32,6 +32,33 @@ class WatchControllerTest(common.HeatTestCase):
|
|||||||
the endpoint processing API requests after they are routed
|
the endpoint processing API requests after they are routed
|
||||||
'''
|
'''
|
||||||
|
|
||||||
|
def setUp(self):
|
||||||
|
super(WatchControllerTest, self).setUp()
|
||||||
|
self.path = os.path.dirname(os.path.realpath(__file__))
|
||||||
|
self.policy_path = self.path + "/../../policy/"
|
||||||
|
self.opts = [
|
||||||
|
cfg.StrOpt('config_dir', default=self.policy_path),
|
||||||
|
cfg.StrOpt('config_file', default='foo'),
|
||||||
|
cfg.StrOpt('project', default='heat'),
|
||||||
|
]
|
||||||
|
cfg.CONF.register_opts(self.opts)
|
||||||
|
cfg.CONF.set_default('host', 'host')
|
||||||
|
self.topic = rpc_api.ENGINE_TOPIC
|
||||||
|
self.api_version = '1.0'
|
||||||
|
|
||||||
|
# Create WSGI controller instance
|
||||||
|
class DummyConfig(object):
|
||||||
|
bind_port = 8003
|
||||||
|
cfgopts = DummyConfig()
|
||||||
|
self.controller = watches.WatchController(options=cfgopts)
|
||||||
|
self.controller.policy.enforcer.policy_path = (self.policy_path +
|
||||||
|
'deny_stack_user.json')
|
||||||
|
self.addCleanup(self.m.VerifyAll)
|
||||||
|
|
||||||
|
def tearDown(self):
|
||||||
|
super(WatchControllerTest, self).tearDown()
|
||||||
|
cfg.CONF.unregister_opts(self.opts)
|
||||||
|
|
||||||
def _dummy_GET_request(self, params=None):
|
def _dummy_GET_request(self, params=None):
|
||||||
# Mangle the params dict into a query string
|
# Mangle the params dict into a query string
|
||||||
params = params or {}
|
params = params or {}
|
||||||
@ -488,26 +515,3 @@ class WatchControllerTest(common.HeatTestCase):
|
|||||||
# should raise HeatInvalidParameterValueError
|
# should raise HeatInvalidParameterValueError
|
||||||
result = self.controller.set_alarm_state(dummy_req)
|
result = self.controller.set_alarm_state(dummy_req)
|
||||||
self.assertIsInstance(result, exception.HeatInvalidParameterValueError)
|
self.assertIsInstance(result, exception.HeatInvalidParameterValueError)
|
||||||
|
|
||||||
def setUp(self):
|
|
||||||
super(WatchControllerTest, self).setUp()
|
|
||||||
self.path = os.path.dirname(os.path.realpath(__file__))
|
|
||||||
self.policy_path = self.path + "/policy/"
|
|
||||||
opts = [
|
|
||||||
cfg.StrOpt('config_dir', default=self.policy_path),
|
|
||||||
cfg.StrOpt('config_file', default='foo'),
|
|
||||||
cfg.StrOpt('project', default='heat'),
|
|
||||||
]
|
|
||||||
cfg.CONF.register_opts(opts)
|
|
||||||
cfg.CONF.set_default('host', 'host')
|
|
||||||
self.topic = rpc_api.ENGINE_TOPIC
|
|
||||||
self.api_version = '1.0'
|
|
||||||
|
|
||||||
# Create WSGI controller instance
|
|
||||||
class DummyConfig(object):
|
|
||||||
bind_port = 8003
|
|
||||||
cfgopts = DummyConfig()
|
|
||||||
self.controller = watches.WatchController(options=cfgopts)
|
|
||||||
self.controller.policy.enforcer.policy_path = (self.policy_path +
|
|
||||||
'deny_stack_user.json')
|
|
||||||
self.addCleanup(self.m.VerifyAll)
|
|
0
heat/tests/api/middleware/__init__.py
Normal file
0
heat/tests/api/middleware/__init__.py
Normal file
0
heat/tests/api/openstack/__init__.py
Normal file
0
heat/tests/api/openstack/__init__.py
Normal file
Loading…
Reference in New Issue
Block a user