Moving test cases
This commit is contained in:
parent
31be6ae6be
commit
a91f0b1087
|
@ -132,33 +132,6 @@ class ClientTestMixin(object):
|
|||
with pytest.raises(MemcacheIllegalInputError):
|
||||
_set()
|
||||
|
||||
def test_set_key_with_space(self):
|
||||
client = self.make_client([b''])
|
||||
|
||||
def _set():
|
||||
client.set(b'key has space', b'value', noreply=False)
|
||||
|
||||
with pytest.raises(MemcacheIllegalInputError):
|
||||
_set()
|
||||
|
||||
def test_set_key_with_newline(self):
|
||||
client = self.make_client([b''])
|
||||
|
||||
def _set():
|
||||
client.set(b'key\n', b'value', noreply=False)
|
||||
|
||||
with pytest.raises(MemcacheIllegalInputError):
|
||||
_set()
|
||||
|
||||
def test_set_key_with_carriage_return(self):
|
||||
client = self.make_client([b''])
|
||||
|
||||
def _set():
|
||||
client.set(b'key\r\n', b'value', noreply=False)
|
||||
|
||||
with pytest.raises(MemcacheIllegalInputError):
|
||||
_set()
|
||||
|
||||
def test_set_unicode_char_in_middle_of_key_ok(self):
|
||||
client = self.make_client([b'STORED\r\n'], allow_unicode_keys=True)
|
||||
|
||||
|
@ -581,6 +554,33 @@ class TestClient(ClientTestMixin, unittest.TestCase):
|
|||
with pytest.raises(MemcacheUnknownError):
|
||||
_set()
|
||||
|
||||
def test_set_key_with_space(self):
|
||||
client = self.make_client([b''])
|
||||
|
||||
def _set():
|
||||
client.set(b'key has space', b'value', noreply=False)
|
||||
|
||||
with pytest.raises(MemcacheIllegalInputError):
|
||||
_set()
|
||||
|
||||
def test_set_key_with_newline(self):
|
||||
client = self.make_client([b''])
|
||||
|
||||
def _set():
|
||||
client.set(b'key\n', b'value', noreply=False)
|
||||
|
||||
with pytest.raises(MemcacheIllegalInputError):
|
||||
_set()
|
||||
|
||||
def test_set_key_with_carriage_return(self):
|
||||
client = self.make_client([b''])
|
||||
|
||||
def _set():
|
||||
client.set(b'key\r\n', b'value', noreply=False)
|
||||
|
||||
with pytest.raises(MemcacheIllegalInputError):
|
||||
_set()
|
||||
|
||||
def test_set_many_socket_handling(self):
|
||||
client = self.make_client([b'STORED\r\n'])
|
||||
result = client.set_many({b'key': b'value'}, noreply=False)
|
||||
|
|
Loading…
Reference in New Issue