diff options
author | Andy McCurdy <andy@andymccurdy.com> | 2013-04-22 15:05:46 -0700 |
---|---|---|
committer | Andy McCurdy <andy@andymccurdy.com> | 2013-04-22 15:05:46 -0700 |
commit | 69b84010fbd495e210887df75fb8b56bcba41a57 (patch) | |
tree | aaa32a1b3a30bc50665f53dcd1e1a9de166c7ef1 /tests/pipeline.py | |
parent | 441ac15a3f8c2968ae7de0990703ee44c7d24f09 (diff) | |
parent | 99e10b1f4f789d7ad1ddbad7369225f88fc3974d (diff) | |
download | redis-py-69b84010fbd495e210887df75fb8b56bcba41a57.tar.gz |
Merge pull request #338 from stephan-hof/corrupted_pipeline_socket
socket gets corrupted if errors in pipeline happen
Diffstat (limited to 'tests/pipeline.py')
-rw-r--r-- | tests/pipeline.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/pipeline.py b/tests/pipeline.py index a21c882..198ee58 100644 --- a/tests/pipeline.py +++ b/tests/pipeline.py @@ -185,3 +185,18 @@ class PipelineTestCase(unittest.TestCase): result = self.client.transaction(my_transaction, 'a', 'b') self.assertEquals(result, [True]) self.assertEquals(self.client.get('c'), b('4')) + + def test_error_in_simple_pipeline(self): + self.client.hmset('x', {'a': 'b'}) + with self.client.pipeline(transaction=False) as pipe: + pipe.llen('x') + pipe.expire('x', 100) + try: + pipe.execute() + except redis.ResponseError: + pass + else: + raise + + ret = self.client.hgetall('x') + self.assertEqual(ret, {b('a'): b('b')}) |