No more DummyContext.
Change-Id: Ifbb7cea17b9fa0df90c15867712a74f4d8a5115d
from nose.plugins.attrib import attr
+from heat.common import context
from heat.engine.resources import autoscaling as asc
from heat.engine.resources import loadbalancer
from heat.engine import parser
return t
def parse_stack(self, t):
- class DummyContext():
- tenant = 'test_tenant'
- username = 'test_username'
- password = 'password'
- auth_url = 'http://localhost:5000/v2.0'
+ ctx = context.RequestContext.from_dict({
+ 'tenant': 'test_tenant',
+ 'username': 'test_username',
+ 'password': 'password',
+ 'auth_url': 'http://localhost:5000/v2.0'})
template = parser.Template(t)
params = parser.Parameters('test_stack', template, {'KeyName': 'test'})
- stack = parser.Stack(DummyContext(), 'test_stack', template,
+ stack = parser.Stack(ctx, 'test_stack', template,
params, stack_id=-1)
return stack
from nose.plugins.attrib import attr
+from heat.common import context
from heat.common import exception
from heat.engine import parser
from heat.engine.resources import stack
return t
def parse_stack(self, t):
- class DummyContext():
- tenant = 'test_tenant'
- tenant_id = '1234abcd'
- username = 'test_username'
- password = 'password'
- auth_url = 'http://localhost:5000/v2.0'
+ ctx = context.RequestContext.from_dict({
+ 'tenant': 'test_tenant',
+ 'tenant_id': '1234abcd',
+ 'username': 'test_username',
+ 'password': 'password',
+ 'auth_url': 'http://localhost:5000/v2.0'})
template = parser.Template(t)
params = parser.Parameters('test_stack', template, {'KeyName': 'test'})
- stack = parser.Stack(DummyContext(), 'test_stack', template,
+ stack = parser.Stack(ctx, 'test_stack', template,
params, stack_id=-1)
return stack
from nose.plugins.attrib import attr
+from heat.common import context
from heat.engine.resources import eip
from heat.engine import parser
from heat.tests.v1_1 import fakes
return t
def parse_stack(self, t):
- class DummyContext():
- tenant = 'test_tenant'
- username = 'test_username'
- password = 'password'
- auth_url = 'http://localhost:5000/v2.0'
+ ctx = context.RequestContext.from_dict({
+ 'tenant': 'test_tenant',
+ 'username': 'test_username',
+ 'password': 'password',
+ 'auth_url': 'http://localhost:5000/v2.0'})
template = parser.Template(t)
params = parser.Parameters('test_stack', template, {'KeyName': 'test'})
- stack = parser.Stack(DummyContext(), 'test_stack', template,
+ stack = parser.Stack(ctx, 'test_stack', template,
params, stack_id=-1)
return stack
from nose.plugins.attrib import attr
+from heat.common import context
from heat.common import exception
from heat.engine.resources import properties
from heat.engine.resources.quantum import net
return t
def parse_stack(self, t):
- class DummyContext():
- tenant = 'test_tenant'
- username = 'test_username'
- password = 'password'
- auth_url = 'http://localhost:5000/v2.0'
- stack = parser.Stack(DummyContext(), 'test_stack', parser.Template(t),
+ ctx = context.RequestContext.from_dict({
+ 'tenant': 'test_tenant',
+ 'username': 'test_username',
+ 'password': 'password',
+ 'auth_url': 'http://localhost:5000/v2.0'})
+ stack = parser.Stack(ctx, 'test_stack', parser.Template(t),
stack_id=-1, parameters={'external_network': 'abcd1234'})
return stack
from nose.plugins.attrib import attr
+from heat.common import context
from heat.engine.resources import s3
from heat.engine import parser
from utils import skip_if
return t
def parse_stack(self, t):
- class DummyContext():
- tenant = 'test_tenant'
- username = 'test_username'
- password = 'password'
- auth_url = 'http://localhost:5000/v2.0'
- stack = parser.Stack(DummyContext(), 'test_stack', parser.Template(t),
+ ctx = context.RequestContext.from_dict({
+ 'tenant': 'test_tenant',
+ 'username': 'test_username',
+ 'password': 'password',
+ 'auth_url': 'http://localhost:5000/v2.0'})
+ stack = parser.Stack(ctx, 'test_stack', parser.Template(t),
stack_id=-1)
return stack
from nose.plugins.attrib import attr
+from heat.common import context
from heat.common import exception
from heat.common import config
from heat.engine import parser
return t
def parse_stack(self, t):
- class DummyContext():
- tenant_id = 'test_tenant'
- username = 'test_username'
- password = 'password'
- auth_url = 'http://localhost:5000/v2.0'
+ ctx = context.RequestContext.from_dict({
+ 'tenant_id': 'test_tenant',
+ 'username': 'test_username',
+ 'password': 'password',
+ 'auth_url': 'http://localhost:5000/v2.0'})
template = parser.Template(t)
params = parser.Parameters('test_stack',
template,
'DBRootPassword': 'test',
'DBUsername': 'test',
'DBPassword': 'test'})
- stack = parser.Stack(DummyContext(), 'test_stack', template,
+ stack = parser.Stack(ctx, 'test_stack', template,
params, stack_id=-1)
return stack
from nose.plugins.attrib import attr
+from heat.common import context
from heat.engine import parser
from heat.engine.resources import volume as vol
from heat.tests.v1_1 import fakes
return t
def parse_stack(self, t):
- class DummyContext():
- tenant = 'test_tenant'
- username = 'test_username'
- password = 'password'
- auth_url = 'http://localhost:5000/v2.0'
+ ctx = context.RequestContext.from_dict({
+ 'tenant': 'test_tenant',
+ 'username': 'test_username',
+ 'password': 'password',
+ 'auth_url': 'http://localhost:5000/v2.0'})
template = parser.Template(t)
params = parser.Parameters('test_stack', template, {'KeyName': 'test'})
- stack = parser.Stack(DummyContext(), 'test_stack', template,
+ stack = parser.Stack(ctx, 'test_stack', template,
params, stack_id=-1)
return stack