assertRaises(Exception, ...) considered harmful
Expecting that Exception is raised can end up passing an a test when an unexpected error occurs. For instance, errors in the unit test itself can be masked: https://review.openstack.org/4848 https://review.openstack.org/4873 https://review.openstack.org/4874 Change a variety of unit tests to expect a more specific exception so we don't run into false positive tests in the future. Change-Id: Ibc0c63b1f6b5574a3ce93d9f02c9d1ff5ac4a8b0
This commit is contained in:
@@ -554,6 +554,10 @@ class NetworkHostNotSet(NovaException):
|
||||
message = _("Host is not set to the network (%(network_id)s).")
|
||||
|
||||
|
||||
class NetworkBusy(NovaException):
|
||||
message = _("Network %(network)s has active ports, cannot delete.")
|
||||
|
||||
|
||||
class DatastoreNotFound(NotFound):
|
||||
message = _("Could not find the datastore reference(s) which the VM uses.")
|
||||
|
||||
|
Reference in New Issue
Block a user