Skip to content

Commit

Permalink
Merge pull request #126 from onovy/32b_fix
Browse files Browse the repository at this point in the history
Fix unit tests failing on 32 bits CPU archs
  • Loading branch information
jamesls committed Sep 6, 2016
2 parents 913d987 + 291b5dc commit 4bfc7a2
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions test_fakeredis.py
Original file line number Diff line number Diff line change
Expand Up @@ -2656,10 +2656,10 @@ def test_ttl_should_return_value_for_expiring_key(self):
self.assertEqual(self.redis.ttl('foo'), 1)
self.redis.expire('foo', 2)
self.assertEqual(self.redis.ttl('foo'), 2)
long_long_c_max = 100000000000
# See https://github.com/antirez/redis/blob/unstable/src/db.c#L632
self.redis.expire('foo', long_long_c_max)
self.assertEqual(self.redis.ttl('foo'), long_long_c_max)
ttl = 1000000000
self.redis.expire('foo', ttl)
self.assertEqual(self.redis.ttl('foo'), ttl)

def test_pttl_should_return_none_for_non_expiring_key(self):
self.redis.set('foo', 'bar')
Expand All @@ -2673,12 +2673,12 @@ def test_pttl_should_return_value_for_expiring_key(self):
self.assertInRange(self.redis.pttl('foo'), 1000 - d, 1000)
self.redis.expire('foo', 2)
self.assertInRange(self.redis.pttl('foo'), 2000 - d, 2000)
long_long_c_max = 100000000000
ttl = 1000000000
# See https://github.com/antirez/redis/blob/unstable/src/db.c#L632
self.redis.expire('foo', long_long_c_max)
self.redis.expire('foo', ttl)
self.assertInRange(self.redis.pttl('foo'),
long_long_c_max * 1000 - d,
long_long_c_max * 1000)
ttl * 1000 - d,
ttl * 1000)

def test_ttls_should_always_be_long(self):
self.redis.set('foo', 'bar')
Expand Down

0 comments on commit 4bfc7a2

Please sign in to comment.