diff options
| author | Michael Gundlach <michael.gundlach@rackspace.com> | 2010-09-20 14:49:05 -0400 |
|---|---|---|
| committer | Michael Gundlach <michael.gundlach@rackspace.com> | 2010-09-20 14:49:05 -0400 |
| commit | ae760b13c5382f2f4719dde445235c156cc27d18 (patch) | |
| tree | 47f467fcc83a2f158f48d52e1c8854a2f1e72448 /nova/api | |
| parent | f200587ce068482ab94e777154de3ac777269fa0 (diff) | |
Use assertRaises
Diffstat (limited to 'nova/api')
| -rw-r--r-- | nova/api/rackspace/ratelimiting/tests.py | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/nova/api/rackspace/ratelimiting/tests.py b/nova/api/rackspace/ratelimiting/tests.py index 13a47989b..4c9510917 100644 --- a/nova/api/rackspace/ratelimiting/tests.py +++ b/nova/api/rackspace/ratelimiting/tests.py @@ -227,13 +227,10 @@ class WSGIAppProxyTest(unittest.TestCase): self.assertEqual(when, 1.5) def test_failure(self): - self.limiter.mock('murder', 'brutus', None) - try: - when = self.proxy.perform('stab', 'brutus') - except AssertionError: - pass - else: - self.fail("I didn't perform the action I expected") + def shouldRaise(): + self.limiter.mock('murder', 'brutus', None) + self.proxy.perform('stab', 'brutus') + self.assertRaises(AssertionError, shouldRaise) if __name__ == '__main__': |
