From e8d286413f25eaa5f09f53080289a05a5df743b9 Mon Sep 17 00:00:00 2001 From: beamerblvd Date: Wed, 1 Nov 2017 15:05:17 -0500 Subject: [PATCH] Fix failing tests and add more Python versions to Travis --- .travis.yml | 4 +++- mockredis/tests/test_script.py | 21 +++++++++++---------- 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/.travis.yml b/.travis.yml index dfae4e5..9778bef 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,11 +9,13 @@ python: - '3.2' - '3.3' - '3.4' +- '3.5' +- '3.6' - pypy - pypy3 install: - pip install . -- if [[ $TRAVIS_PYTHON_VERSION == 2.7 ]] || [[ $TRAVIS_PYTHON_VERSION == 3.4 ]]; then pip install .[lua]; fi +- if [[ "$TRAVIS_PYTHON_VERSION" =~ ^(2.7|3.4|3.5|3.6)$ ]]; then pip install .[lua]; fi script: python setup.py nosetests deploy: provider: pypi diff --git a/mockredis/tests/test_script.py b/mockredis/tests/test_script.py index fac39fe..d94a4fe 100644 --- a/mockredis/tests/test_script.py +++ b/mockredis/tests/test_script.py @@ -15,6 +15,7 @@ LIST1, LIST2, SET1, VAL1, VAL2, VAL3, VAL4, + bVAL1, bVAL2, bVAL3, bVAL4, LPOP_SCRIPT ) @@ -110,7 +111,7 @@ def test_register_script_lpush(self): script(keys=[LIST1], args=[VAL1, VAL2]) # validate insertion - eq_([VAL2, VAL1], self.redis.lrange(LIST1, 0, -1)) + eq_([bVAL2, bVAL1], self.redis.lrange(LIST1, 0, -1)) def test_register_script_lpop(self): self.redis.lpush(LIST1, VAL2, VAL1) @@ -122,7 +123,7 @@ def test_register_script_lpop(self): # validate lpop eq_(VAL1, list_item) - eq_([VAL2], self.redis.lrange(LIST1, 0, -1)) + eq_([bVAL2], self.redis.lrange(LIST1, 0, -1)) def test_register_script_rpoplpush(self): self.redis.lpush(LIST1, VAL2, VAL1) @@ -134,8 +135,8 @@ def test_register_script_rpoplpush(self): script(keys=[LIST1, LIST2]) # validate rpoplpush - eq_([VAL1], self.redis.lrange(LIST1, 0, -1)) - eq_([VAL2, VAL3, VAL4], self.redis.lrange(LIST2, 0, -1)) + eq_([bVAL1], self.redis.lrange(LIST1, 0, -1)) + eq_([bVAL2, bVAL3, bVAL4], self.redis.lrange(LIST2, 0, -1)) def test_register_script_rpop_lpush(self): self.redis.lpush(LIST1, VAL2, VAL1) @@ -150,8 +151,8 @@ def test_register_script_rpop_lpush(self): script(keys=[LIST1, LIST2]) # validate rpop and then lpush - eq_([VAL1], self.redis.lrange(LIST1, 0, -1)) - eq_([VAL2, VAL3, VAL4], self.redis.lrange(LIST2, 0, -1)) + eq_([bVAL1], self.redis.lrange(LIST1, 0, -1)) + eq_([bVAL2, bVAL3, bVAL4], self.redis.lrange(LIST2, 0, -1)) def test_register_script_client(self): # lpush two values in LIST1 in first instance of redis @@ -170,8 +171,8 @@ def test_register_script_client(self): # validate lpop from LIST1 in redis2 eq_(VAL3, list_item) - eq_([VAL4], redis2.lrange(LIST1, 0, -1)) - eq_([VAL1, VAL2], self.redis.lrange(LIST1, 0, -1)) + eq_([bVAL4], redis2.lrange(LIST1, 0, -1)) + eq_([bVAL1, bVAL2], self.redis.lrange(LIST1, 0, -1)) def test_eval_lpush(self): # lpush two values @@ -179,7 +180,7 @@ def test_eval_lpush(self): self.redis.eval(script_content, 1, LIST1, VAL1, VAL2) # validate insertion - eq_([VAL2, VAL1], self.redis.lrange(LIST1, 0, -1)) + eq_([bVAL2, bVAL1], self.redis.lrange(LIST1, 0, -1)) def test_eval_lpop(self): self.redis.lpush(LIST1, VAL2, VAL1) @@ -190,7 +191,7 @@ def test_eval_lpop(self): # validate lpop eq_(VAL1, list_item) - eq_([VAL2], self.redis.lrange(LIST1, 0, -1)) + eq_([bVAL2], self.redis.lrange(LIST1, 0, -1)) def test_eval_lrem(self): self.redis.delete(LIST1)