tests: Remove references to soft_lock
As best as I can tell, this has *never* been an interface. Change-Id: I42e4b82a7af8a81e497e68ad25ac3bc4d0d74970
This commit is contained in:
parent
9c5cbaa5c5
commit
69b18e3c50
@ -462,10 +462,6 @@ class FakeMemcache(object):
|
||||
def decr(self, key, delta=1, time=0):
|
||||
return self.incr(key, delta=-delta, time=time)
|
||||
|
||||
@contextmanager
|
||||
def soft_lock(self, key, timeout=0, retries=5):
|
||||
yield True
|
||||
|
||||
@track
|
||||
def delete(self, key):
|
||||
try:
|
||||
|
@ -9904,32 +9904,6 @@ class TestContainerController(unittest.TestCase):
|
||||
resp = getattr(controller, meth)(req)
|
||||
self.assertEqual(resp.status_int, 404)
|
||||
|
||||
def test_put_locking(self):
|
||||
|
||||
class MockMemcache(FakeMemcache):
|
||||
|
||||
def __init__(self, allow_lock=None):
|
||||
self.allow_lock = allow_lock
|
||||
super(MockMemcache, self).__init__()
|
||||
|
||||
@contextmanager
|
||||
def soft_lock(self, key, timeout=0, retries=5):
|
||||
if self.allow_lock:
|
||||
yield True
|
||||
else:
|
||||
raise NotImplementedError
|
||||
|
||||
with save_globals():
|
||||
controller = proxy_server.ContainerController(self.app, 'account',
|
||||
'container')
|
||||
self.app.memcache = MockMemcache(allow_lock=True)
|
||||
set_http_connect(200, 201, 201, 201,
|
||||
missing_container=True)
|
||||
req = Request.blank('/v1/a/c', environ={'REQUEST_METHOD': 'PUT'})
|
||||
self.app.update_request(req)
|
||||
res = controller.PUT(req)
|
||||
self.assertEqual(res.status_int, 201)
|
||||
|
||||
def test_error_limiting(self):
|
||||
with save_globals():
|
||||
controller = proxy_server.ContainerController(self.app, 'account',
|
||||
|
Loading…
x
Reference in New Issue
Block a user