Skip to content

Commit

Permalink
test: add testcase for expire when set config with zero.
Browse files Browse the repository at this point in the history
  • Loading branch information
laixintao committed Sep 30, 2020
1 parent 8699e65 commit ed08cb6
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions t/unit/backends/test_redis.py
Expand Up @@ -556,6 +556,11 @@ def test_expire(self):
self.b.expire('foo', 300)
self.b.client.expire.assert_called_with('foo', 300)

def test_expire_with_zero(self):
self.b.client = Mock(name='client')
self.b.expire('foo', 0)
self.b.client.expire.assert_not_called()

def test_apply_chord(self, unlock='celery.chord_unlock'):
self.app.tasks[unlock] = Mock()
header_result = self.app.GroupResult(
Expand Down

0 comments on commit ed08cb6

Please sign in to comment.