예제 #1
0
    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)
예제 #2
0
 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())
예제 #3
0
 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())
예제 #4
0
파일: test_plan.py 프로젝트: meloxl/stacker
 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),
     )
예제 #5
0
 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)
예제 #6
0
 def setUp(self):
     self.count = 0
     self.config = Config({"namespace": "namespace"})
     self.context = Context(config=self.config)
     register_lookup_handler("noop", lambda **kwargs: "test")
예제 #7
0
 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)
예제 #8
0
 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)
예제 #9
0
 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))