diff options
Diffstat (limited to 'neutronclient/tests/unit/test_cli20.py')
| -rw-r--r-- | neutronclient/tests/unit/test_cli20.py | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/neutronclient/tests/unit/test_cli20.py b/neutronclient/tests/unit/test_cli20.py index 725e80f..c5b5709 100644 --- a/neutronclient/tests/unit/test_cli20.py +++ b/neutronclient/tests/unit/test_cli20.py @@ -695,13 +695,10 @@ class ClientV2TestJson(CLITestV20Base): def test_do_request_with_long_uri_exception(self): long_string = 'x' * 8200 # 8200 > MAX_URI_LEN:8192 params = {'id': long_string} - - try: - self.client.do_request('GET', '/test', body='', params=params) - except exceptions.RequestURITooLong as cm: - self.assertNotEqual(0, cm.excess) - else: - self.fail('Expected exception NOT raised') + exception = self.assertRaises(exceptions.RequestURITooLong, + self.client.do_request, + 'GET', '/test', body='', params=params) + self.assertNotEqual(0, exception.excess) def test_do_request_request_ids(self): self.mox.StubOutWithMock(self.client.httpclient, "request") |
