From: Akihiro Motoki Date: Wed, 19 Feb 2014 19:37:39 +0000 (+0900) Subject: Should specify expect_errors=False for success response X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=5754c4bcbc9677f8b306c3f29a8574693df0e278;p=openstack-build%2Fneutron-build.git 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 --- diff --git a/neutron/tests/unit/test_api_v2_resource.py b/neutron/tests/unit/test_api_v2_resource.py index ed3ea33fc..298283cb9 100644 --- a/neutron/tests/unit/test_api_v2_resource.py +++ b/neutron/tests/unit/test_api_v2_resource.py @@ -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)