summaryrefslogtreecommitdiffstats
path: root/nova
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2013-07-01 06:53:31 +0000
committerGerrit Code Review <review@openstack.org>2013-07-01 06:53:31 +0000
commitdd1b4e5a602f9cc907325c6b0c30b5fa7d7c05c1 (patch)
tree9dc41d2bc273216ff7f1576d3f524e6d03ed4346 /nova
parent1515fa7bc3f5244f7564ce41f8a7a9ed9dacd5ee (diff)
parentc978691a5fcd7332a81a9f4b229c244ac0a3a6d9 (diff)
downloadnova-dd1b4e5a602f9cc907325c6b0c30b5fa7d7c05c1.tar.gz
nova-dd1b4e5a602f9cc907325c6b0c30b5fa7d7c05c1.tar.xz
nova-dd1b4e5a602f9cc907325c6b0c30b5fa7d7c05c1.zip
Merge "Fix types in test_ec2_ids_not_found_are_printable"
Diffstat (limited to 'nova')
-rw-r--r--nova/tests/db/test_db_api.py20
1 files changed, 10 insertions, 10 deletions
diff --git a/nova/tests/db/test_db_api.py b/nova/tests/db/test_db_api.py
index 0b49210fa..e7ae1b76d 100644
--- a/nova/tests/db/test_db_api.py
+++ b/nova/tests/db/test_db_api.py
@@ -153,18 +153,18 @@ class DbApiTestCase(DbTestCase):
self.flags(osapi_compute_unique_server_name_scope=None)
def test_ec2_ids_not_found_are_printable(self):
- def check_exc_format(method):
+ def check_exc_format(method, value):
try:
- method(self.context, 'fake')
+ method(self.context, value)
except exception.NotFound as exc:
- self.assertTrue('fake' in unicode(exc))
-
- check_exc_format(db.get_ec2_volume_id_by_uuid)
- check_exc_format(db.get_volume_uuid_by_ec2_id)
- check_exc_format(db.get_ec2_snapshot_id_by_uuid)
- check_exc_format(db.get_snapshot_uuid_by_ec2_id)
- check_exc_format(db.get_ec2_instance_id_by_uuid)
- check_exc_format(db.get_instance_uuid_by_ec2_id)
+ self.assertTrue(unicode(value) in unicode(exc))
+
+ check_exc_format(db.get_ec2_volume_id_by_uuid, 'fake')
+ check_exc_format(db.get_volume_uuid_by_ec2_id, 123456)
+ check_exc_format(db.get_ec2_snapshot_id_by_uuid, 'fake')
+ check_exc_format(db.get_snapshot_uuid_by_ec2_id, 123456)
+ check_exc_format(db.get_ec2_instance_id_by_uuid, 'fake')
+ check_exc_format(db.get_instance_uuid_by_ec2_id, 123456)
def test_instance_get_all_with_meta(self):
inst = self.create_instance_with_args()