diff options
author | Eric Du <eric@honovation.com> | 2015-05-04 10:28:24 +0800 |
---|---|---|
committer | Eric Du <eric@honovation.com> | 2015-05-04 10:28:24 +0800 |
commit | 19d48d81ce3227d5f9544072c9c6915133b0f75c (patch) | |
tree | a2a9a4ae808342ad67df92ea17094f708976d673 /tests/test_encoding.py | |
parent | bc61eb925af5de3317937529413cca4a49c4cd3b (diff) | |
download | redis-py-19d48d81ce3227d5f9544072c9c6915133b0f75c.tar.gz |
fix: Connection.encode complains when value is an object having unicode characters in its printable representation
Diffstat (limited to 'tests/test_encoding.py')
-rw-r--r-- | tests/test_encoding.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/test_encoding.py b/tests/test_encoding.py index b1df0a5..f0c67be 100644 --- a/tests/test_encoding.py +++ b/tests/test_encoding.py @@ -23,6 +23,13 @@ class TestEncoding(object): r.rpush('a', *result) assert r.lrange('a', 0, -1) == result + def test_object_value(self, r): + unicode_string = unichr(3456) + u('abcd') + unichr(3421) + r['unicode-string'] = Exception(unicode_string) + cached_val = r['unicode-string'] + assert isinstance(cached_val, unicode) + assert unicode_string == cached_val + class TestCommandsAndTokensArentEncoded(object): @pytest.fixture() |