|
19 | 19 | from pywps.exceptions import MissingParameterValue |
20 | 20 |
|
21 | 21 | from pywps.tests import assert_pywps_version, client_for |
| 22 | +from pywps.tests import assert_process_exception |
22 | 23 |
|
23 | 24 | ProcessDescription = namedtuple('ProcessDescription', ['identifier', 'inputs', 'metadata']) |
24 | 25 |
|
@@ -90,14 +91,15 @@ def test_get_request_all_args(self): |
90 | 91 | assert 'hello metadata' in [item for sublist in metadata for item in sublist] |
91 | 92 |
|
92 | 93 | def test_get_request_zero_args(self): |
93 | | - with self.assertRaises(MissingParameterValue) as e: |
94 | | - resp = self.client.get('?Request=DescribeProcess&version=1.0.0&service=wps') |
95 | | - assert resp.status_code == 400 # bad request, identifier is missing |
| 94 | + # with self.assertRaises(MissingParameterValue) as e: |
| 95 | + resp = self.client.get('?Request=DescribeProcess&version=1.0.0&service=wps') |
| 96 | + # bad request, identifier is missing |
| 97 | + assert_process_exception(resp, code='MissingParameterValue') |
96 | 98 |
|
97 | 99 | def test_get_request_nonexisting_process_args(self): |
98 | | - with self.assertRaises(InvalidParameterValue) as e: |
99 | | - resp = self.client.get('?Request=DescribeProcess&version=1.0.0&service=wps&identifier=NONEXISTINGPROCESS') |
100 | | - assert resp.status_code == 400 |
| 100 | + resp = self.client.get('?Request=DescribeProcess&version=1.0.0&service=wps&identifier=NONEXISTINGPROCESS') |
| 101 | + # bad request, identifier does not exist |
| 102 | + assert_process_exception(resp, code='InvalidParameterValue') |
101 | 103 |
|
102 | 104 | def test_post_request_zero_args(self): |
103 | 105 | request_doc = WPS.DescribeProcess() |
|
0 commit comments