Skip to content
This repository has been archived by the owner on Jan 24, 2023. It is now read-only.

Commit

Permalink
[fix] fixes per PR suggestion
Browse files Browse the repository at this point in the history
  • Loading branch information
filipecosta90 committed Aug 31, 2020
1 parent 91e5498 commit 775db11
Showing 1 changed file with 27 additions and 20 deletions.
47 changes: 27 additions & 20 deletions test_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,14 @@ def testCreate(self):
info = rts.info(4)
self.assertEqual(20, info.retention_msecs)
self.assertEqual('Series', info.labels['Time'])
if version is None or version < 14000 return
# Test for a chunk size of 128 Bytes
self.assertTrue(rts.create("time-serie-1",chunk_size=128))
info = rts.info("time-serie-1")
self.assertEqual(128, info.chunk_size)

if version is None or version < 14000:
return

# Test for a chunk size of 128 Bytes
self.assertTrue(rts.create("time-serie-1",chunk_size=128))
info = rts.info("time-serie-1")
self.assertEqual(128, info.chunk_size)


def testAlter(self):
Expand Down Expand Up @@ -65,11 +68,13 @@ def testAdd(self):
self.assertEqual(10, info.retention_msecs)
self.assertEqual('Labs', info.labels['Redis'])

if version is not None and version >= 14000:
# Test for a chunk size of 128 Bytes on TS.ADD
self.assertTrue(rts.add("time-serie-1", 1, 10.0, chunk_size=128))
info = rts.info("time-serie-1")
self.assertEqual(128, info.chunk_size)
if version is None or version < 14000:
return

# Test for a chunk size of 128 Bytes on TS.ADD
self.assertTrue(rts.add("time-serie-1", 1, 10.0, chunk_size=128))
info = rts.info("time-serie-1")
self.assertEqual(128, info.chunk_size)

def testMAdd(self):
'''Test TS.MADD calls'''
Expand All @@ -95,16 +100,18 @@ def testIncrbyDecrby(self):
self.assertEqual((7, 3.75), rts.get(2))
self.assertTrue(rts.decrby(2, 1.5, timestamp=15))
self.assertEqual((15, 2.25), rts.get(2))
if version is not None and version >= 14000:
# Test for a chunk size of 128 Bytes on TS.INCRBY
self.assertTrue(rts.incrby("time-serie-1", 10, chunk_size=128))
info = rts.info("time-serie-1")
self.assertEqual(128, info.chunk_size)

# Test for a chunk size of 128 Bytes on TS.DECRBY
self.assertTrue(rts.decrby("time-serie-2", 10, chunk_size=128))
info = rts.info("time-serie-2")
self.assertEqual(128, info.chunk_size)
if version is None or version < 14000:
return

# Test for a chunk size of 128 Bytes on TS.INCRBY
self.assertTrue(rts.incrby("time-serie-1", 10, chunk_size=128))
info = rts.info("time-serie-1")
self.assertEqual(128, info.chunk_size)

# Test for a chunk size of 128 Bytes on TS.DECRBY
self.assertTrue(rts.decrby("time-serie-2", 10, chunk_size=128))
info = rts.info("time-serie-2")
self.assertEqual(128, info.chunk_size)

def testCreateRule(self):
'''Test TS.CREATERULE and TS.DELETERULE calls'''
Expand Down

0 comments on commit 775db11

Please sign in to comment.