diff options
| author | Jenkins <jenkins@review.openstack.org> | 2012-08-10 23:04:18 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2012-08-10 23:04:18 +0000 |
| commit | b962f98a18a4070ae859b8a98b4169e37db6fa69 (patch) | |
| tree | cbbab0daa817face4fb7a83d3d73f6a67a015842 /nova/tests | |
| parent | 4e596a171f7dc1a4140726b1cfab85976f98243a (diff) | |
| parent | f546f62397979312dd891509c31feadf149b8c59 (diff) | |
Merge "Make sure ec2 mapping raises proper exceptions"
Diffstat (limited to 'nova/tests')
| -rw-r--r-- | nova/tests/test_db_api.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/nova/tests/test_db_api.py b/nova/tests/test_db_api.py index 4a7adb001..b664f54e4 100644 --- a/nova/tests/test_db_api.py +++ b/nova/tests/test_db_api.py @@ -45,6 +45,21 @@ class DbApiTestCase(test.TestCase): args.update(kwargs) return db.instance_create(self.context, args) + def test_ec2_ids_not_found_are_printable(self): + + def check_exc_format(method): + try: + method(self.context, 'fake') + except Exception 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) + def test_instance_get_all_by_filters(self): self.create_instances_with_args() self.create_instances_with_args() |
