Fix syntax errors

This commit is contained in:
Nicholas Charriere 2016-11-05 11:11:02 -07:00
parent 5a99916bcd
commit 197f419437
4 changed files with 14 additions and 7 deletions

View File

@ -232,7 +232,8 @@ class Client(object):
def check_key(self, key):
"""Checks key and add key_prefix."""
return _check_key(key, allow_unicode_keys=self.allow_unicode_keys, key_prefix=self.key_prefix)
return _check_key(key, allow_unicode_keys=self.allow_unicode_keys,
key_prefix=self.key_prefix)
def _connect(self):
sock = self.socket_module.socket(self.socket_module.AF_INET,
@ -872,7 +873,8 @@ class PooledClient(object):
def check_key(self, key):
"""Checks key and add key_prefix."""
return _check_key(key, allow_unicode_keys=self.allow_unicode_keys, key_prefix=self.key_prefix)
return _check_key(key, allow_unicode_keys=self.allow_unicode_keys,
key_prefix=self.key_prefix)
def _create_client(self):
client = Client(self.server,

View File

@ -135,7 +135,8 @@ class ClientTestMixin(object):
def test_set_unicode_char_in_middle_of_key_ok(self):
client = self.make_client([b'STORED\r\n'], allow_unicode_keys=True)
result = client.set('helloworld_\xb1901520_%c3', b'value', noreply=False)
result = client.set('helloworld_\xb1901520_%c3', b'value',
noreply=False)
assert result is True
def test_set_noreply(self):
@ -727,7 +728,8 @@ class TestClient(ClientTestMixin, unittest.TestCase):
self._default_noreply_true('touch', (b'key',), [b'NOT_FOUND\r\n'])
def test_default_noreply_flush_all(self):
self._default_noreply_false('flush_all', (), [b'__FAKE_RESPONSE__\r\n'])
self._default_noreply_false('flush_all', (),
[b'__FAKE_RESPONSE__\r\n'])
self._default_noreply_true('flush_all', (), [b'__FAKE_RESPONSE__\r\n'])
def test_version_success(self):
@ -831,7 +833,8 @@ class TestPooledClient(ClientTestMixin, unittest.TestCase):
self._default_noreply_true('touch', (b'key',), [b'NOT_FOUND\r\n'])
def test_default_noreply_flush_all(self):
self._default_noreply_false('flush_all', (), [b'__FAKE_RESPONSE__\r\n'])
self._default_noreply_false('flush_all', (),
[b'__FAKE_RESPONSE__\r\n'])
self._default_noreply_true('flush_all', (), [b'__FAKE_RESPONSE__\r\n'])

View File

@ -12,7 +12,8 @@ import socket
class TestHashClient(ClientTestMixin, unittest.TestCase):
def make_client_pool(self, hostname, mock_socket_values, serializer=None, **kwargs):
def make_client_pool(self, hostname, mock_socket_values,
serializer=None, **kwargs):
mock_client = Client(hostname, serializer=serializer, **kwargs)
mock_client.sock = MockSocket(mock_socket_values)
client = PooledClient(hostname, serializer=serializer)

View File

@ -57,7 +57,8 @@ def test_get_set(client_class, host, port, socket_module):
@pytest.mark.integration()
def test_get_set_unicode_key(client_class, host, port, socket_module):
client = client_class((host, port), socket_module=socket_module, allow_unicode_keys=True)
client = client_class((host, port), socket_module=socket_module,
allow_unicode_keys=True)
client.flush_all()
key = u"こんにちは"