示例#1
0
 def test_validate_password_without_user(self):
     self.rsrc_defn['Properties']['credentials'].pop('user')
     ds = data_source.DataSource('data-source', self.rsrc_defn, self.stack)
     ex = self.assertRaises(exception.StackValidationFailed, ds.validate)
     error_msg = ('Property error: resources.data-source.properties.'
                  'credentials: Property user not assigned')
     self.assertEqual(error_msg, six.text_type(ex))
示例#2
0
 def test_validate_password_without_user(self):
     props = self.stack.t.t['resources']['data-source']['properties'].copy()
     del props['credentials']['user']
     self.rsrc_defn = self.rsrc_defn.freeze(properties=props)
     ds = data_source.DataSource('data-source', self.rsrc_defn, self.stack)
     ex = self.assertRaises(exception.StackValidationFailed, ds.validate)
     error_msg = ('Property error: resources.data-source.properties.'
                  'credentials: Property user not assigned')
     self.assertEqual(error_msg, six.text_type(ex))
示例#3
0
 def _create_resource(self, name, snippet, stack):
     ds = data_source.DataSource(name, snippet, stack)
     value = mock.MagicMock(id='12345')
     self.client.data_sources.create.return_value = value
     scheduler.TaskRunner(ds.create)()
     return ds