Esempio n. 1
0
 def test_construct_input_data(self):
     expected_input_data = {'attrs': {'value': None},
                            'id': mock.ANY,
                            'physical_resource_id': None,
                            'name': 'A'}
     actual_input_data = worker.construct_input_data(self.resource)
     self.assertEqual(expected_input_data, actual_input_data)
Esempio n. 2
0
 def test_construct_input_data(self):
     expected_input_data = {'attrs': {'value': None},
                            'id': mock.ANY,
                            'physical_resource_id': None,
                            'name': 'A'}
     actual_input_data = worker.construct_input_data(self.resource)
     self.assertEqual(expected_input_data, actual_input_data)
Esempio n. 3
0
 def test_construct_input_data_exception(self):
     expected_input_data = {'attrs': {},
                            'id': mock.ANY,
                            'physical_resource_id': None,
                            'name': 'A'}
     self.resource.FnGetAtt = mock.Mock(
         side_effect=exception.InvalidTemplateAttribute(resource='A',
                                                        key='value'))
     actual_input_data = worker.construct_input_data(self.resource)
     self.assertEqual(expected_input_data, actual_input_data)
Esempio n. 4
0
 def test_construct_input_data_ok(self):
     expected_input_data = {'attrs': {(u'flat_dict', u'key2'): 'val2',
                                      (u'flat_dict', u'key3'): 'val3',
                                      (u'nested_dict', u'dict', u'a'): 1,
                                      (u'nested_dict', u'dict', u'b'): 2},
                            'id': mock.ANY,
                            'reference_id': 'A',
                            'name': 'A'}
     actual_input_data = worker.construct_input_data(self.resource)
     self.assertEqual(expected_input_data, actual_input_data)
Esempio n. 5
0
 def test_construct_input_data_exception(self):
     expected_input_data = {'attrs': {},
                            'id': mock.ANY,
                            'reference_id': 'A',
                            'name': 'A'}
     self.resource.FnGetAtt = mock.Mock(
         side_effect=exception.InvalidTemplateAttribute(resource='A',
                                                        key='value'))
     actual_input_data = worker.construct_input_data(self.resource)
     self.assertEqual(expected_input_data, actual_input_data)
Esempio n. 6
0
 def test_construct_input_data_ok(self):
     expected_input_data = {'attrs': {(u'flat_dict', u'key2'): 'val2',
                                      (u'flat_dict', u'key3'): 'val3',
                                      (u'nested_dict', u'dict', u'a'): 1,
                                      (u'nested_dict', u'dict', u'b'): 2},
                            'id': mock.ANY,
                            'reference_id': 'A',
                            'name': 'A'}
     actual_input_data = worker.construct_input_data(self.resource)
     self.assertEqual(expected_input_data, actual_input_data)
Esempio n. 7
0
 def test_construct_input_data_exception(self):
     expected_input_data = {
         "attrs": {},
         "id": mock.ANY,
         "reference_id": "A",
         "name": "A",
         "uuid": mock.ANY,
         "action": mock.ANY,
         "status": mock.ANY,
     }
     self.resource.FnGetAtt = mock.Mock(side_effect=exception.InvalidTemplateAttribute(resource="A", key="value"))
     actual_input_data = worker.construct_input_data(self.resource, self.stack)
     self.assertEqual(expected_input_data, actual_input_data)
 def test_construct_input_data_exception(self):
     expected_input_data = {'attrs': {},
                            'id': mock.ANY,
                            'reference_id': 'A',
                            'name': 'A',
                            'uuid': mock.ANY,
                            'action': mock.ANY,
                            'status': mock.ANY}
     self.resource.get_attribute = mock.Mock(
         side_effect=exception.InvalidTemplateAttribute(resource='A',
                                                        key='value'))
     actual_input_data = worker.construct_input_data(self.resource,
                                                     self.stack)
     self.assertEqual(expected_input_data, actual_input_data)
Esempio n. 9
0
 def test_construct_input_data_ok(self):
     expected_input_data = {
         "attrs": {
             (u"flat_dict", u"key2"): "val2",
             (u"flat_dict", u"key3"): "val3",
             (u"nested_dict", u"dict", u"a"): 1,
             (u"nested_dict", u"dict", u"b"): 2,
         },
         "id": mock.ANY,
         "reference_id": "A",
         "name": "A",
         "uuid": mock.ANY,
         "action": mock.ANY,
         "status": mock.ANY,
     }
     actual_input_data = worker.construct_input_data(self.resource, self.stack)
     self.assertEqual(expected_input_data, actual_input_data)