diff options
author | Prashanth Pai <ppai@redhat.com> | 2014-03-12 16:54:30 +0530 |
---|---|---|
committer | Luis Pabon <lpabon@redhat.com> | 2014-03-13 05:09:19 -0700 |
commit | 2ccd2c4d969cdd6e7feedd21ac2e5cb8498ff37d (patch) | |
tree | 1886732cf56e26ab836f9fd67c853eff2005fbeb /test/unit/proxy/controllers/test_obj.py | |
parent | 1a6b55714fddf7a1b526a31ee3f27589f01e98e5 (diff) |
Sync with OpenStack Swift v1.13.0
Also, bumped version of gluster-swift to v1.13.0
Change-Id: I797dc704c9523540cba847b1e8ff3da97b79630c
Signed-off-by: Prashanth Pai <ppai@redhat.com>
Reviewed-on: http://review.gluster.org/7229
Reviewed-by: Chetan Risbud <crisbud@redhat.com>
Reviewed-by: Luis Pabon <lpabon@redhat.com>
Tested-by: Luis Pabon <lpabon@redhat.com>
Diffstat (limited to 'test/unit/proxy/controllers/test_obj.py')
-rwxr-xr-x | test/unit/proxy/controllers/test_obj.py | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/test/unit/proxy/controllers/test_obj.py b/test/unit/proxy/controllers/test_obj.py index cae62b0..aada616 100755 --- a/test/unit/proxy/controllers/test_obj.py +++ b/test/unit/proxy/controllers/test_obj.py @@ -21,6 +21,7 @@ import mock import swift from swift.proxy import server as proxy_server +from swift.common.swob import HTTPException from test.unit import FakeRing, FakeMemcache, fake_http_connect @@ -44,7 +45,7 @@ class TestObjControllerWriteAffinity(unittest.TestCase): self.app = proxy_server.Application( None, FakeMemcache(), account_ring=FakeRing(), container_ring=FakeRing(), object_ring=FakeRing(max_more_nodes=9)) - self.app.request_node_count = lambda ring: 10000000 + self.app.request_node_count = lambda replicas: 10000000 self.app.sort_nodes = lambda l: l # stop shuffling the primary nodes def test_iter_nodes_local_first_noops_when_no_affinity(self): @@ -107,14 +108,20 @@ class TestObjController(unittest.TestCase): # and now test that we add the header to log_info req = swift.common.swob.Request.blank('/v1/a/c/o') req.headers['x-copy-from'] = 'somewhere' - controller.PUT(req) + try: + controller.PUT(req) + except HTTPException: + pass self.assertEquals( req.environ.get('swift.log_info'), ['x-copy-from:somewhere']) # and then check that we don't do that for originating POSTs req = swift.common.swob.Request.blank('/v1/a/c/o') req.method = 'POST' req.headers['x-copy-from'] = 'elsewhere' - controller.PUT(req) + try: + controller.PUT(req) + except HTTPException: + pass self.assertEquals(req.environ.get('swift.log_info'), None) |