def test_s3_static_website(self): """Test a static website blog bucket.""" ctx = Context(config=Config({'namespace': 'test'})) blueprint = Buckets('s3_static_website', ctx) v = self.variables = [ Variable( 'Buckets', { 'Blog': { 'AccessControl': 'PublicRead', 'WebsiteConfiguration': { 'IndexDocument': 'index.html' } }, }), Variable('ReadRoles', [ 'Role1', 'Role2', ]), Variable('ReadWriteRoles', [ 'Role3', 'Role4', ]), ] blueprint.resolve_variables(v) blueprint.create_template() self.assertRenderedBlueprint(blueprint)
def setUp(self): config = Config({ "namespace": "namespace", "stacks": [ { "name": "vpc" }, { "name": "bastion", "requires": ["vpc"] }, { "name": "instance", "requires": ["vpc", "bastion"] }, { "name": "db", "requires": ["instance", "vpc", "bastion"] }, { "name": "other", "requires": ["db"] }, ], }) self.context = Context(config=config) self.action = destroy.Action(self.context, provider=mock.MagicMock())
def setUp(self): config = Config({ "namespace": "namespace", "stacks": [ { "name": "vpc" }, { "name": "bastion", "requires": ["vpc"] }, { "name": "instance", "requires": ["vpc", "bastion"] }, { "name": "db", "requires": ["instance", "vpc", "bastion"] }, { "name": "other", "requires": ["db"] }, ], }) self.context = Context(config=config) self.action = destroy.Action(self.context, cancel=MockThreadingEvent())
def setUp(self): self.config = Config({"namespace": "namespace"}) self.context = Context(config=self.config) stack = Stack( definition=generate_definition("vpc", 1), context=self.context, ) self.step = Step( stack=stack, run_func=lambda x, y: (x, y), )
def _get_context(self, **kwargs): config = Config({ "namespace": "namespace", "stacks": [ {"name": "vpc"}, {"name": "bastion", "variables": { "test": "${output vpc::something}"}}, {"name": "db", "variables": { "test": "${output vpc::something}", "else": "${output bastion::something}"}}, {"name": "other", "variables": {}} ], }) return Context(config=config, **kwargs)
def setUp(self): self.count = 0 self.config = Config({"namespace": "namespace"}) self.context = Context(config=self.config) register_lookup_handler("noop", lambda **kwargs: "test")
def test_kinesis(self): ctx = Context(config=Config({'namespace': 'test'})) blueprint = Streams('streams', ctx) blueprint.resolve_variables(self.variables) blueprint.create_template() self.assertRenderedBlueprint(blueprint)
def test_s3(self): ctx = Context(config=Config({'namespace': 'test'})) blueprint = Buckets('buckets', ctx) blueprint.resolve_variables(self.variables) blueprint.create_template() self.assertRenderedBlueprint(blueprint)
def setUp(self): self.context = Context(config=Config({"namespace": "namespace"})) self.provider = TestProvider() self.build_action = build.Action(self.context, provider_builder=MockProviderBuilder( self.provider))