Move all api tests to /tests/api

Move all api tests to /tests/api/*.

Change-Id: Ib5a61a61a19827aad8b2d5fb5d4e2d19450da72a
This commit is contained in:
Rakesh H S 2015-07-07 23:15:16 +05:30
parent cf8f36c44b
commit e0d0bb9305
17 changed files with 34 additions and 26 deletions

View File

View File

View File

View File

@ -29,7 +29,7 @@ from heat.rpc import client as rpc_client
from heat.tests import common
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):
@ -41,12 +41,12 @@ class CfnStackControllerTest(common.HeatTestCase):
def setUp(self):
super(CfnStackControllerTest, self).setUp()
opts = [
self.opts = [
cfg.StrOpt('config_dir', default=policy_path),
cfg.StrOpt('config_file', default='foo'),
cfg.StrOpt('project', default='heat'),
]
cfg.CONF.register_opts(opts)
cfg.CONF.register_opts(self.opts)
cfg.CONF.set_default('host', 'host')
self.topic = rpc_api.ENGINE_TOPIC
self.api_version = '1.0'
@ -62,6 +62,10 @@ class CfnStackControllerTest(common.HeatTestCase):
'deny_stack_user.json')
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):
# Mangle the params dict into a query string
params = params or {}

View File

View File

@ -32,6 +32,33 @@ class WatchControllerTest(common.HeatTestCase):
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):
# Mangle the params dict into a query string
params = params or {}
@ -488,26 +515,3 @@ class WatchControllerTest(common.HeatTestCase):
# should raise HeatInvalidParameterValueError
result = self.controller.set_alarm_state(dummy_req)
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)

View File

View File