Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
* Fixed storing non-ASCII values on Python 2 and binary values on Python 3
(PR from Nicolas Noé) #135

* Fixed touch(..., time=0) command (PR from Nicolas Noé) #137

Fri, 27 May 2016 13:44:55 -0600 Sean Reifschneider <jafo@tummy.com>

* 1.58 release.
Expand Down
2 changes: 1 addition & 1 deletion memcache.py
Original file line number Diff line number Diff line change
Expand Up @@ -553,7 +553,7 @@ def _deletetouch(self, expected, cmd, key, time=0, noreply=False):
if not server:
return 0
self._statlog(cmd)
if time is not None and time != 0:
if time is not None:
headers = str(time)
else:
headers = None
Expand Down
7 changes: 7 additions & 0 deletions tests/test_memcache.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,13 @@ def test_delete(self):
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)
Expand Down