diff options
| author | David Ripton <dripton@redhat.com> | 2013-05-28 16:21:25 -0400 |
|---|---|---|
| committer | David Ripton <dripton@redhat.com> | 2013-05-28 21:28:33 -0400 |
| commit | d0e50669d1397ebfd8331b483eabe11f3554efdf (patch) | |
| tree | 9946a2cb71330cfd38374c42fe3b17cd8a7c193b /nova/tests | |
| parent | a081faa41887a28d775f7cf6e85484ed0420ced0 (diff) | |
| download | nova-d0e50669d1397ebfd8331b483eabe11f3554efdf.tar.gz nova-d0e50669d1397ebfd8331b483eabe11f3554efdf.tar.xz nova-d0e50669d1397ebfd8331b483eabe11f3554efdf.zip | |
Raise exception instances, not exception classes.
Raising raw exception classes works, but is old deprecated syntax, and
may bite us later.
Change-Id: I03f41da267ce5cbfc5ea98c531acc9a9b13e082a
Diffstat (limited to 'nova/tests')
| -rw-r--r-- | nova/tests/api/openstack/compute/contrib/test_coverage_ext.py | 2 | ||||
| -rw-r--r-- | nova/tests/compute/test_compute.py | 2 | ||||
| -rw-r--r-- | nova/tests/fake_ldap.py | 12 | ||||
| -rw-r--r-- | nova/tests/test_utils.py | 2 |
4 files changed, 9 insertions, 9 deletions
diff --git a/nova/tests/api/openstack/compute/contrib/test_coverage_ext.py b/nova/tests/api/openstack/compute/contrib/test_coverage_ext.py index cd4229ddd..957625b34 100644 --- a/nova/tests/api/openstack/compute/contrib/test_coverage_ext.py +++ b/nova/tests/api/openstack/compute/contrib/test_coverage_ext.py @@ -47,7 +47,7 @@ class FakeCoverage(object): def stop(self): if not self.started: - raise AssertionError + raise AssertionError() self.started = False def report(self, file): diff --git a/nova/tests/compute/test_compute.py b/nova/tests/compute/test_compute.py index f5c23ccee..38403dd24 100644 --- a/nova/tests/compute/test_compute.py +++ b/nova/tests/compute/test_compute.py @@ -7462,7 +7462,7 @@ class ComputeAPITestCase(BaseTestCase): def fake_libvirt_driver_detach_volume_fails(*args, **kwargs): called['fake_libvirt_driver_detach_volume_fails'] = True - raise AttributeError + raise AttributeError() def fake_roll_detaching(*args, **kwargs): called['fake_roll_detaching'] = True diff --git a/nova/tests/fake_ldap.py b/nova/tests/fake_ldap.py index b3fab03ab..7b587ffe2 100644 --- a/nova/tests/fake_ldap.py +++ b/nova/tests/fake_ldap.py @@ -217,19 +217,19 @@ class FakeLDAP(object): def simple_bind_s(self, dn, password): """This method is ignored, but provided for compatibility.""" if server_fail: - raise SERVER_DOWN + raise SERVER_DOWN() pass def unbind_s(self): """This method is ignored, but provided for compatibility.""" if server_fail: - raise SERVER_DOWN + raise SERVER_DOWN() pass def add_s(self, dn, attr): """Add an object with the specified attributes at dn.""" if server_fail: - raise SERVER_DOWN + raise SERVER_DOWN() key = "%s%s" % (self.__prefix, dn) value_dict = dict([(k, _to_json(v)) for k, v in attr]) @@ -238,7 +238,7 @@ class FakeLDAP(object): def delete_s(self, dn): """Remove the ldap object at specified dn.""" if server_fail: - raise SERVER_DOWN + raise SERVER_DOWN() Store.instance().delete("%s%s" % (self.__prefix, dn)) @@ -252,7 +252,7 @@ class FakeLDAP(object): """ if server_fail: - raise SERVER_DOWN + raise SERVER_DOWN() store = Store.instance() key = "%s%s" % (self.__prefix, dn) @@ -292,7 +292,7 @@ class FakeLDAP(object): """ if server_fail: - raise SERVER_DOWN + raise SERVER_DOWN() if scope != SCOPE_BASE and scope != SCOPE_SUBTREE: raise NotImplementedError(str(scope)) diff --git a/nova/tests/test_utils.py b/nova/tests/test_utils.py index a2abedda8..f400bb899 100644 --- a/nova/tests/test_utils.py +++ b/nova/tests/test_utils.py @@ -325,7 +325,7 @@ class GenericUtilsTestCase(test.TestCase): def test_read_file_as_root(self): def fake_execute(*args, **kwargs): if args[1] == 'bad': - raise processutils.ProcessExecutionError + raise processutils.ProcessExecutionError() return 'fakecontents', None self.stubs.Set(utils, 'execute', fake_execute) |
