diff options
author | Andy McCurdy <andy@andymccurdy.com> | 2018-11-06 17:00:30 -0800 |
---|---|---|
committer | Andy McCurdy <andy@andymccurdy.com> | 2018-11-06 17:00:30 -0800 |
commit | b95319584da99ac4ffd02b04257d14a3da5b3713 (patch) | |
tree | 2143c21132cdce2e24db1cb2627762fca11f116d | |
parent | 7b39a14f94f032d9fd71128e9f54d7adf18e5711 (diff) | |
download | redis-py-b95319584da99ac4ffd02b04257d14a3da5b3713.tar.gz |
confirm bitfield works with pipelines
-rw-r--r-- | tests/test_pipeline.py | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/test_pipeline.py b/tests/test_pipeline.py index a8941d7..3d63d91 100644 --- a/tests/test_pipeline.py +++ b/tests/test_pipeline.py @@ -252,3 +252,20 @@ class TestPipeline(object): assert unicode(ex.value).startswith(expected) assert r[key] == b'1' + + def test_pipeline_with_bitfield(self, r): + with r.pipeline() as pipe: + pipe.set('a', '1') + bf = pipe.bitfield('b') + pipe2 = (bf + .set('u8', 8, 255) + .get('u8', 0) + .get('u4', 8) # 1111 + .get('u4', 12) # 1111 + .get('u4', 13) # 1110 + .execute()) + pipe.get('a') + response = pipe.execute() + + assert pipe == pipe2 + assert response == [True, [0, 0, 15, 15, 14], b'1'] |