File swift-drop-test_ratelimit_max_rate_multiple_acc.patch of Package openstack-swift
diff -ruN a/test/unit/common/middleware/test_ratelimit.py b/test/unit/common/middleware/test_ratelimit.py
--- a/test/unit/common/middleware/test_ratelimit.py 2013-06-13 23:36:37.000000000 +0200
+++ b/test/unit/common/middleware/test_ratelimit.py 2013-07-04 15:34:03.375156989 +0200
@@ -345,43 +345,6 @@
r = self.test_ratelimit(req.environ, start_response)
self.assertEquals(r[0], '204 No Content')
- def test_ratelimit_max_rate_multiple_acc(self):
- num_calls = 4
- current_rate = 2
- conf_dict = {'account_ratelimit': current_rate,
- 'max_sleep_time_seconds': 2}
- fake_memcache = FakeMemcache()
-
- the_app = ratelimit.RateLimitMiddleware(None, conf_dict,
- logger=FakeLogger())
- the_app.memcache_client = fake_memcache
- req = lambda: None
- req.method = 'PUT'
-
- class rate_caller(Thread):
-
- def __init__(self, name):
- self.myname = name
- Thread.__init__(self)
-
- def run(self):
- for j in range(num_calls):
- self.result = the_app.handle_ratelimit(req, self.myname,
- 'c', None)
-
- nt = 15
- begin = time.time()
- threads = []
- for i in range(nt):
- rc = rate_caller('a%s' % i)
- rc.start()
- threads.append(rc)
- for thread in threads:
- thread.join()
-
- time_took = time.time() - begin
- self.assertEquals(1.5, round(time_took, 1))
-
def test_call_invalid_path(self):
env = {'REQUEST_METHOD': 'GET',
'SCRIPT_NAME': '',
Binary files a/test/unit/common/middleware/.test_ratelimit.py.swp and b/test/unit/common/middleware/.test_ratelimit.py.swp differ