diff options
| author | Vishvananda Ishaya <vishvananda@gmail.com> | 2011-06-02 12:01:49 -0700 |
|---|---|---|
| committer | Vishvananda Ishaya <vishvananda@gmail.com> | 2011-06-02 12:01:49 -0700 |
| commit | ae1842174f4b079c8d84b32ddad4df1b7ff29bec (patch) | |
| tree | 2e2027174b123bd3925d5b1da8016c937ce6678e /nova/tests | |
| parent | 8b6de21b5ed4248998eef7deb57b1bc4f3863276 (diff) | |
Tests to assure all exceptions can be raised as well as fixing NotAuthorized
Diffstat (limited to 'nova/tests')
| -rw-r--r-- | nova/tests/test_misc.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/nova/tests/test_misc.py b/nova/tests/test_misc.py index cf8f4c05e..c5875a843 100644 --- a/nova/tests/test_misc.py +++ b/nova/tests/test_misc.py @@ -21,11 +21,24 @@ import select from eventlet import greenpool from eventlet import greenthread +from nova import exception from nova import test from nova import utils from nova.utils import parse_mailmap, str_dict_replace +class ExceptionTestCase(test.TestCase): + @staticmethod + def _raise_exc(exc): + raise exc() + + def test_exceptions_raise(self): + for name in dir(exception): + exc = getattr(exception, name) + if isinstance(exc, type): + self.assertRaises(exc, self._raise_exc, exc) + + class ProjectTestCase(test.TestCase): def test_authors_up_to_date(self): topdir = os.path.normpath(os.path.dirname(__file__) + '/../../') |
