Пример #1
0
 def test_args(self):
     body = {
         'parameters': {},
         'stack_name': 'foo',
         'template': {},
         'template_url': 'http://example.com/',
         'timeout_mins': 60,
     }
     data = stacks.InstantiationData(body)
     self.assertEqual(data.args(), {'timeout_mins': 60})
Пример #2
0
    def test_template_priority(self):
        template = {'foo': 'bar', 'blarg': 'wibble'}
        url = 'http://example.com/template'
        body = {'template': template, 'template_url': url}
        data = stacks.InstantiationData(body)

        self.m.StubOutWithMock(data, '_load_template')
        self.m.ReplayAll()

        self.assertEqual(data.template(), template)
        self.m.VerifyAll()
Пример #3
0
 def test_template_missing(self):
     template = {'foo': 'bar', 'blarg': 'wibble'}
     body = {'not the template': template}
     data = stacks.InstantiationData(body)
     self.assertRaises(webob.exc.HTTPBadRequest, data.template)
Пример #4
0
 def test_template_inline(self):
     template = {'foo': 'bar', 'blarg': 'wibble'}
     body = {'template': template}
     data = stacks.InstantiationData(body)
     self.assertEqual(data.template(), template)
Пример #5
0
 def test_stack_name_missing(self):
     body = {'not the stack_name': 'wibble'}
     data = stacks.InstantiationData(body)
     self.assertRaises(webob.exc.HTTPBadRequest, data.stack_name)
Пример #6
0
 def test_stack_name(self):
     body = {'stack_name': 'wibble'}
     data = stacks.InstantiationData(body)
     self.assertEqual(data.stack_name(), 'wibble')
Пример #7
0
 def test_user_params_missing(self):
     params = {'foo': 'bar', 'blarg': 'wibble'}
     body = {'not the parameters': params}
     data = stacks.InstantiationData(body)
     self.assertEqual(data.user_params(), {})