summaryrefslogtreecommitdiff
path: root/tests/server_commands.py
diff options
context:
space:
mode:
authorFrankie Dintino <fdintino@theatlantic.com>2012-02-08 15:33:17 -0500
committerFrankie Dintino <fdintino@theatlantic.com>2012-02-08 15:33:17 -0500
commit8e1a5bb29c48c2fc4e009ad3f90d1a7055c7dfa9 (patch)
treef88e06b2c1f56339247fd8a631ca8488d33e9fc8 /tests/server_commands.py
parent43f5e969afd64bf4f5d34751d108e989588a4506 (diff)
downloadredis-py-8e1a5bb29c48c2fc4e009ad3f90d1a7055c7dfa9.tar.gz
Added unit tests for unicode handling in PythonParser and HiredisParser
Diffstat (limited to 'tests/server_commands.py')
-rw-r--r--tests/server_commands.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/tests/server_commands.py b/tests/server_commands.py
index 680a0c7..7dc4fad 100644
--- a/tests/server_commands.py
+++ b/tests/server_commands.py
@@ -47,9 +47,10 @@ class ServerCommandsTestCase(unittest.TestCase):
self.assert_(self.client.set('unicode_string', unicode_string))
self.assertEquals(self.client.get('byte_string'), byte_string)
self.assertEquals(self.client.get('integer'), str(integer))
- self.assertEquals(
- self.client.get('unicode_string').decode('utf-8'),
- unicode_string)
+ cache_value = self.client.get('unicode_string')
+ if isinstance(cache_value, str):
+ cache_value = cache_value.decode('utf-8')
+ self.assertEquals(cache_value, unicode_string)
def test_getitem_and_setitem(self):
self.client['a'] = 'bar'