From 0b47212f4f2f7584a840ab3978ccdfc8f8f4fd90 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20No=C3=A9?= Date: Wed, 14 Dec 2016 10:44:34 +0100 Subject: Fix touch(..., time=0) sending invalid command to memcache Without the trailing '0', the command is invalid. --- tests/test_memcache.py | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'tests') diff --git a/tests/test_memcache.py b/tests/test_memcache.py index b5f8884..40b6524 100644 --- a/tests/test_memcache.py +++ b/tests/test_memcache.py @@ -51,6 +51,13 @@ class TestMemcache(unittest.TestCase): self.assertEqual(result, True) self.assertEqual(self.mc.get("long"), None) + @mock.patch.object(_Host, 'send_cmd') + @mock.patch.object(_Host, 'readline') + def test_touch(self, mock_readline, mock_send_cmd): + with captured_stderr(): + self.mc.touch('key') + mock_send_cmd.assert_called_with(b'touch key 0') + def test_get_multi(self): self.check_setget("gm_a_string", "some random string") self.check_setget("gm_an_integer", 42) -- cgit v1.2.1