Commits

Mike Bayer  committed 1fdf65e

broken test for incoming pullreq

  • Participants
  • Parent commits 6555a5d

Comments (0)

Files changed (2)

File dogpile/cache/compat.py

         def callable(fn):
             return hasattr(fn, '__call__')
 
+    def u(s):
+        return s
+
     import configparser
     import io
     import _thread as thread
     text_type = unicode
     string_type = str
 
+    def u(s):
+        return unicode(s, "utf-8")
+
     import ConfigParser as configparser
     import StringIO as io
 
+
     callable = callable
     import thread
 

File tests/cache/test_decorator.py

+#! coding: utf-8
+
 from ._fixtures import _GenericBackendFixture
 from . import eq_
 from unittest import TestCase
 import time
-from dogpile.cache import util
+from dogpile.cache import util, compat
 import itertools
 from dogpile.cache.api import NO_VALUE
 
         eq_(gen(1, 2), "tests.cache.test_decorator:one|mynamespace|1 2")
         eq_(gen(None, 5), "tests.cache.test_decorator:one|mynamespace|None 5")
 
+    def test_unicode_key(self):
+        decorate, canary = self._keygen_decorator("mynamespace")
+
+        @decorate
+        def one(a, b):
+            pass
+        gen = canary[0]
+
+        eq_(gen(compat.u('méil'), compat.u('drôle')),
+                compat.u("tests.cache.test_decorator:one|mynamespace|1 2"))
+
+
 class CacheDecoratorTest(_GenericBackendFixture, TestCase):
     backend = "mock"
     #def _region(self, init_args={}, config_args={}, backend="mock"):