@mock.patch.object(db_api, 'stack_count_total_resources')
def test_total_resources_generic(self, sctr):
    tpl = {'HeatTemplateFormatVersion': '2012-12-12', 'Resources': {'A': {'Type': 'GenericResourceType'}}}
    self.stack = stack.Stack(self.ctx, 'test_stack', template.Template(tpl), status_reason='blarg')
    self.stack.store()
    sctr.return_value = 1
    self.assertEqual(1, self.stack.total_resources(self.stack.id))
    self.assertEqual(1, self.stack.total_resources())
@mock.patch.object(db_api, 'stack_count_total_resources')
def test_total_resources_generic(self, sctr):
    tpl = {'HeatTemplateFormatVersion': '2012-12-12', 'Resources': {'A': {'Type': 'GenericResourceType'}}}
    self.stack = stack.Stack(self.ctx, 'test_stack', template.Template(tpl), status_reason='blarg')
    self.stack.store()
    sctr.return_value = 1
    self.assertEqual(1, self.stack.total_resources(self.stack.id))
    self.assertEqual(1, self.stack.total_resources())