Package: python-pymemcache / 1.2.4-2

fix-test-to-work-with-python3.2.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
Description: Fix test to work with Python 3.2
 There's some u'' unicode strings which wouldn't work in Python 3.2, this
 patch fixes that.
Author: Thomas Goirand <zigo@debian.org>
Forwarded: no
Last-Update: 2014-08-14

--- python-pymemcache-1.2.4.orig/pymemcache/test/test_client.py
+++ python-pymemcache-1.2.4/pymemcache/test/test_client.py
@@ -17,6 +17,8 @@ import json
 import socket
 import unittest
 
+import six
+
 from nose import tools
 from pymemcache.client import Client, MemcacheUnknownCommandError
 from pymemcache.client import MemcacheClientError, MemcacheServerError
@@ -75,7 +77,7 @@ class ClientTestMixin(object):
         client.sock = MockSocket([b''])
 
         def _set():
-            client.set(u'\u0FFF', b'value', noreply=False)
+            client.set(six.u('\u0FFF'), b'value', noreply=False)
 
         tools.assert_raises(MemcacheIllegalInputError, _set)
 
@@ -84,7 +86,7 @@ class ClientTestMixin(object):
         client.sock = MockSocket([b''])
 
         def _set():
-            client.set(b'key', u'\u0FFF', noreply=False)
+            client.set(b'key', six.u('\u0FFF'), noreply=False)
 
         tools.assert_raises(MemcacheIllegalInputError, _set)
 
@@ -165,7 +167,7 @@ class ClientTestMixin(object):
         client.sock = MockSocket([b''])
 
         def _get():
-            client.get(u'\u0FFF')
+            client.get(six.u('\u0FFF'))
 
         tools.assert_raises(MemcacheIllegalInputError, _get)
 
@@ -627,7 +629,7 @@ class TestClient(ClientTestMixin, unitte
     def test_key_contains_nonascii(self):
         client = self.Client(None)
         client.sock = MockSocket([b'END\r\n'])
-        tools.assert_raises(MemcacheClientError, client.get, u'\u3053\u3093\u306b\u3061\u306f')
+        tools.assert_raises(MemcacheClientError, client.get, six.u('\u3053\u3093\u306b\u3061\u306f'))
 
 
 class TestMockClient(ClientTestMixin, unittest.TestCase):