From: Chris Alfonso Date: Thu, 19 Apr 2012 22:10:20 +0000 (-0400) Subject: Added db setup and teardown with sqlite X-Git-Tag: 2014.1~1938^2~1 X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=7b039d4a7523e3468c3bad7eeea6f30ddf428cca;p=openstack-build%2Fheat-build.git Added db setup and teardown with sqlite --- diff --git a/heat/tests/test_resources.py b/heat/tests/test_resources.py index 3c3d6135..731557b5 100644 --- a/heat/tests/test_resources.py +++ b/heat/tests/test_resources.py @@ -69,29 +69,18 @@ class ResourcesTest(unittest.TestCase): instance.itype_oflavor['256 MB Server'] = '256 MB Server' instance.create() - - def test_initialize_instance_from_template(self): - f = open('templates/WordPress_Single_Instance_gold.template') - t = f.read() - f.close() - - stack = self._mox.CreateMockAnything() - stack.id().AndReturn(1) - self._mox.StubOutWithMock(stack, 'resolve_static_refs') - stack.resolve_static_refs(t).AndReturn(t) - - self._mox.StubOutWithMock(stack, 'resolve_find_in_map') - stack.resolve_find_in_map(t).AndReturn(t) - - self._mox.StubOutWithMock(db_api, 'resource_get_by_name_and_stack') - db_api.resource_get_by_name_and_stack(None, 'test_resource_name', stack).AndReturn(None) + print self.cs.flavors.list()[0].name + self.m.ReplayAll() + t['Resources']['WebServer']['Properties']['ImageId'] = 'CentOS 5.2' + t['Resources']['WebServer']['Properties']['InstanceType'] = '256 MB Server' + instance = resources.Instance('test_resource_name',\ + t['Resources']['WebServer'], stack) - self._mox.ReplayAll() - instance = resources.Instance('test_resource_name', t, stack) + instance.itype_oflavor['256 MB Server'] = '256 MB Server' + instance.create() - - # allows testing of the test directly, shown below + # allows testing of the test directly, shown below if __name__ == '__main__': sys.argv.append(__file__) nose.main()