|
@@ -41,11 +41,11 @@ class test_CacheBackend(AppCase):
|
|
CacheBackend(backend=None, app=self.app)
|
|
CacheBackend(backend=None, app=self.app)
|
|
|
|
|
|
def test_mark_as_done(self):
|
|
def test_mark_as_done(self):
|
|
- self.assertEqual(self.tb.get_status(self.tid), states.PENDING)
|
|
|
|
|
|
+ self.assertEqual(self.tb.get_state(self.tid), states.PENDING)
|
|
self.assertIsNone(self.tb.get_result(self.tid))
|
|
self.assertIsNone(self.tb.get_result(self.tid))
|
|
|
|
|
|
self.tb.mark_as_done(self.tid, 42)
|
|
self.tb.mark_as_done(self.tid, 42)
|
|
- self.assertEqual(self.tb.get_status(self.tid), states.SUCCESS)
|
|
|
|
|
|
+ self.assertEqual(self.tb.get_state(self.tid), states.SUCCESS)
|
|
self.assertEqual(self.tb.get_result(self.tid), 42)
|
|
self.assertEqual(self.tb.get_result(self.tid), 42)
|
|
|
|
|
|
def test_is_pickled(self):
|
|
def test_is_pickled(self):
|
|
@@ -61,7 +61,7 @@ class test_CacheBackend(AppCase):
|
|
raise KeyError('foo')
|
|
raise KeyError('foo')
|
|
except KeyError as exception:
|
|
except KeyError as exception:
|
|
self.tb.mark_as_failure(self.tid, exception)
|
|
self.tb.mark_as_failure(self.tid, exception)
|
|
- self.assertEqual(self.tb.get_status(self.tid), states.FAILURE)
|
|
|
|
|
|
+ self.assertEqual(self.tb.get_state(self.tid), states.FAILURE)
|
|
self.assertIsInstance(self.tb.get_result(self.tid), KeyError)
|
|
self.assertIsInstance(self.tb.get_result(self.tid), KeyError)
|
|
|
|
|
|
def test_apply_chord(self):
|
|
def test_apply_chord(self):
|
|
@@ -219,7 +219,7 @@ class test_memcache_key(AppCase, MockCacheMixin):
|
|
cache._imp = [None]
|
|
cache._imp = [None]
|
|
task_id, result = string(uuid()), 42
|
|
task_id, result = string(uuid()), 42
|
|
b = cache.CacheBackend(backend='memcache', app=self.app)
|
|
b = cache.CacheBackend(backend='memcache', app=self.app)
|
|
- b.store_result(task_id, result, status=states.SUCCESS)
|
|
|
|
|
|
+ b.store_result(task_id, result, state=states.SUCCESS)
|
|
self.assertEqual(b.get_result(task_id), result)
|
|
self.assertEqual(b.get_result(task_id), result)
|
|
|
|
|
|
def test_memcache_bytes_key(self):
|
|
def test_memcache_bytes_key(self):
|
|
@@ -230,7 +230,7 @@ class test_memcache_key(AppCase, MockCacheMixin):
|
|
cache._imp = [None]
|
|
cache._imp = [None]
|
|
task_id, result = str_to_bytes(uuid()), 42
|
|
task_id, result = str_to_bytes(uuid()), 42
|
|
b = cache.CacheBackend(backend='memcache', app=self.app)
|
|
b = cache.CacheBackend(backend='memcache', app=self.app)
|
|
- b.store_result(task_id, result, status=states.SUCCESS)
|
|
|
|
|
|
+ b.store_result(task_id, result, state=states.SUCCESS)
|
|
self.assertEqual(b.get_result(task_id), result)
|
|
self.assertEqual(b.get_result(task_id), result)
|
|
|
|
|
|
def test_pylibmc_unicode_key(self):
|
|
def test_pylibmc_unicode_key(self):
|
|
@@ -240,7 +240,7 @@ class test_memcache_key(AppCase, MockCacheMixin):
|
|
cache._imp = [None]
|
|
cache._imp = [None]
|
|
task_id, result = string(uuid()), 42
|
|
task_id, result = string(uuid()), 42
|
|
b = cache.CacheBackend(backend='memcache', app=self.app)
|
|
b = cache.CacheBackend(backend='memcache', app=self.app)
|
|
- b.store_result(task_id, result, status=states.SUCCESS)
|
|
|
|
|
|
+ b.store_result(task_id, result, state=states.SUCCESS)
|
|
self.assertEqual(b.get_result(task_id), result)
|
|
self.assertEqual(b.get_result(task_id), result)
|
|
|
|
|
|
def test_pylibmc_bytes_key(self):
|
|
def test_pylibmc_bytes_key(self):
|
|
@@ -250,5 +250,5 @@ class test_memcache_key(AppCase, MockCacheMixin):
|
|
cache._imp = [None]
|
|
cache._imp = [None]
|
|
task_id, result = str_to_bytes(uuid()), 42
|
|
task_id, result = str_to_bytes(uuid()), 42
|
|
b = cache.CacheBackend(backend='memcache', app=self.app)
|
|
b = cache.CacheBackend(backend='memcache', app=self.app)
|
|
- b.store_result(task_id, result, status=states.SUCCESS)
|
|
|
|
|
|
+ b.store_result(task_id, result, state=states.SUCCESS)
|
|
self.assertEqual(b.get_result(task_id), result)
|
|
self.assertEqual(b.get_result(task_id), result)
|