diff options
Diffstat (limited to 'nova/tests')
| -rw-r--r-- | nova/tests/image/test_glance.py | 4 | ||||
| -rw-r--r-- | nova/tests/test_cloud.py | 12 |
2 files changed, 13 insertions, 3 deletions
diff --git a/nova/tests/image/test_glance.py b/nova/tests/image/test_glance.py index 041da1e13..223e7ae57 100644 --- a/nova/tests/image/test_glance.py +++ b/nova/tests/image/test_glance.py @@ -60,10 +60,8 @@ class BaseGlanceTest(unittest.TestCase): NOW_DATETIME = datetime.datetime(2010, 10, 11, 10, 30, 22) def setUp(self): - # FIXME(sirp): we can probably use stubs library here rather than - # dependency injection self.client = StubGlanceClient(None) - self.service = glance.GlanceImageService(self.client) + self.service = glance.GlanceImageService(client=self.client) self.context = context.RequestContext(None, None) def assertDateTimesFilled(self, image_meta): diff --git a/nova/tests/test_cloud.py b/nova/tests/test_cloud.py index ba133c860..13046f861 100644 --- a/nova/tests/test_cloud.py +++ b/nova/tests/test_cloud.py @@ -115,6 +115,18 @@ class CloudTestCase(test.TestCase): public_ip=address) db.floating_ip_destroy(self.context, address) + def test_allocate_address(self): + address = "10.10.10.10" + allocate = self.cloud.allocate_address + db.floating_ip_create(self.context, + {'address': address, + 'host': self.network.host}) + self.assertEqual(allocate(self.context)['publicIp'], address) + db.floating_ip_destroy(self.context, address) + self.assertRaises(exception.NoMoreFloatingIps, + allocate, + self.context) + def test_associate_disassociate_address(self): """Verifies associate runs cleanly without raising an exception""" address = "10.10.10.10" |
