diff options
author | Hanno Schlichting <hanno@hannosch.eu> | 2012-09-21 14:42:09 +0200 |
---|---|---|
committer | Hanno Schlichting <hanno@hannosch.eu> | 2012-09-21 14:42:09 +0200 |
commit | 7c161e097d198e6c766a3a085d9b915e3803d7e0 (patch) | |
tree | 673fe76d731c2256e8edc3ac3c376b1bd6198533 /kazoo/tests/test_paths.py | |
parent | 520d9b30bcbc3059dad4c4d19bbc46a53a801e8d (diff) | |
download | kazoo-7c161e097d198e6c766a3a085d9b915e3803d7e0.tar.gz |
deal with `u''` in test_paths
Diffstat (limited to 'kazoo/tests/test_paths.py')
-rw-r--r-- | kazoo/tests/test_paths.py | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/kazoo/tests/test_paths.py b/kazoo/tests/test_paths.py index eed30da..e092196 100644 --- a/kazoo/tests/test_paths.py +++ b/kazoo/tests/test_paths.py @@ -1,8 +1,17 @@ +import sys from unittest import TestCase from kazoo.protocol import paths +if sys.version_info > (3, ): # pragma: nocover + def u(s): + return s +else: # pragma: nocover + def u(s): + return unicode(s, "unicode_escape") + + class NormPathTestCase(TestCase): def test_normpath(self): @@ -12,7 +21,7 @@ class NormPathTestCase(TestCase): self.assertEqual(paths.normpath(''), '') def test_normpath_unicode(self): - self.assertEqual(paths.normpath(u'/\xe4/b'), u'/\xe4/b') + self.assertEqual(paths.normpath(u('/\xe4/b')), u('/\xe4/b')) def test_normpath_dots(self): self.assertEqual(paths.normpath('/a./b../c'), '/a./b../c') |