diff options
| author | Sandy Walsh <sandy.walsh@rackspace.com> | 2011-06-13 09:43:41 -0700 |
|---|---|---|
| committer | Sandy Walsh <sandy.walsh@rackspace.com> | 2011-06-13 09:43:41 -0700 |
| commit | 276ecb29455acbbf82bbf99ce2b522eba44a0acc (patch) | |
| tree | f56721c01ae31fc53ff406da4feefb5be8cac02a /nova/tests | |
| parent | db3280e5177df92484bf0a52b5f6ed89dfea63dd (diff) | |
| parent | 91e34d37d2907295e892e96ca2c3039c7fbe14bf (diff) | |
| download | nova-276ecb29455acbbf82bbf99ce2b522eba44a0acc.tar.gz nova-276ecb29455acbbf82bbf99ce2b522eba44a0acc.tar.xz nova-276ecb29455acbbf82bbf99ce2b522eba44a0acc.zip | |
trunk merge
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" |
