Should specify expect_errors=False for success response

In API unit tests, expect_errors=False should be specified
when expecting 2xx API response.

Closes-Bug: #1282401
Change-Id: Ib2d57aab16f73f234b3cb6ecfeecf2779bf17223
This commit is contained in:
Akihiro Motoki 2014-02-20 04:37:39 +09:00
parent 705da7e7f0
commit 88cd12055c

View File

@ -311,7 +311,7 @@ class ResourceTestCase(base.BaseTestCase):
resource = webtest.TestApp(wsgi_resource.Resource(controller))
environ = {'wsgiorg.routing_args': (None, {'action': 'test'})}
res = resource.get('', extra_environ=environ, expect_errors=True)
res = resource.get('', extra_environ=environ)
self.assertEqual(res.status_int, 200)
def test_status_204(self):
@ -321,7 +321,7 @@ class ResourceTestCase(base.BaseTestCase):
resource = webtest.TestApp(wsgi_resource.Resource(controller))
environ = {'wsgiorg.routing_args': (None, {'action': 'delete'})}
res = resource.delete('', extra_environ=environ, expect_errors=True)
res = resource.delete('', extra_environ=environ)
self.assertEqual(res.status_int, 204)
def test_no_route_args(self):
@ -341,5 +341,5 @@ class ResourceTestCase(base.BaseTestCase):
environ = {'wsgiorg.routing_args': (None, {'action': 'test'})}
res = resource.post('', params='{"key": "val"}',
extra_environ=environ, expect_errors=True)
extra_environ=environ)
self.assertEqual(res.status_int, 200)