diff options
| author | amitt001 | 2016-10-28 00:55:31 +0530 |
|---|---|---|
| committer | Barry Warsaw | 2016-10-30 18:11:34 -0400 |
| commit | 61347daf381156ddd63b3983b105c2412c22f998 (patch) | |
| tree | 53e3018a764c224e9792a852256042da45b16c6f /src/mailman/rest | |
| parent | 94d0949ac6565f329b79fc54e9f56d335cdc647a (diff) | |
| download | mailman-61347daf381156ddd63b3983b105c2412c22f998.tar.gz mailman-61347daf381156ddd63b3983b105c2412c22f998.tar.zst mailman-61347daf381156ddd63b3983b105c2412c22f998.zip | |
Diffstat (limited to 'src/mailman/rest')
| -rw-r--r-- | src/mailman/rest/tests/test_basic.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/mailman/rest/tests/test_basic.py b/src/mailman/rest/tests/test_basic.py index 64c60842c..fade3ed40 100644 --- a/src/mailman/rest/tests/test_basic.py +++ b/src/mailman/rest/tests/test_basic.py @@ -26,6 +26,7 @@ from mailman.app.lifecycle import create_list from mailman.database.transaction import transaction from mailman.testing.helpers import call_api from mailman.testing.layers import RESTLayer +from urllib.error import HTTPError class TestBasicREST(unittest.TestCase): @@ -45,3 +46,10 @@ class TestBasicREST(unittest.TestCase): # This fails with Falcon 0.2; passes with Falcon 0.3. self.assertEqual(self._mlist.description, 'A description with , to check stuff') + + def test_send_error(self): + # Test `AdminWebServiceWSGIRequestHandler` `send_error`. + # Return 400 for invalid url. + with self.assertRaises(HTTPError) as cm: + call_api('http://localhost:9001/3.0/lists/test @example.com') + self.assertEqual(cm.exception.code, 400) |
