summaryrefslogtreecommitdiffstats
path: root/test/unit/proxy/controllers/test_obj.py
diff options
context:
space:
mode:
Diffstat (limited to 'test/unit/proxy/controllers/test_obj.py')
-rwxr-xr-xtest/unit/proxy/controllers/test_obj.py13
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)