]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
Should specify expect_errors=False for success response
authorAkihiro Motoki <motoki@da.jp.nec.com>
Wed, 19 Feb 2014 19:37:39 +0000 (04:37 +0900)
committerThomas Goirand <thomas@goirand.fr>
Thu, 13 Mar 2014 07:20:25 +0000 (15:20 +0800)
In API unit tests, expect_errors=False should be specified
when expecting 2xx API response.

Closes-Bug: #1282401
Change-Id: Ib2d57aab16f73f234b3cb6ecfeecf2779bf17223

neutron/tests/unit/test_api_v2_resource.py

index ed3ea33fc6186402ee2a3a6e32e73621a7b76a0f..298283cb957d3549a1ed4abe0a226e39a660a2d6 100644 (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)