diff options
| author | Victor Stinner <vstinner@redhat.com> | 2015-07-27 18:08:10 +0200 |
|---|---|---|
| committer | Victor Stinner <vstinner@redhat.com> | 2015-07-27 18:08:10 +0200 |
| commit | 3fde65eeae0019ec0971442886331fb7ffbcdffb (patch) | |
| tree | d9e9bb91d2c73af79597d9ed6a3066a923e5149f /tests/test_setmulti.py | |
| parent | d9c602ffb15c2619788d159a2fe0aeb1de282f85 (diff) | |
| download | python-memcached-3fde65eeae0019ec0971442886331fb7ffbcdffb.tar.gz | |
More Python 3 fixes
* Port set_multi() to Python 3
* Port delete_multi() to Python 3
* Fix _get_server() on Python 3 when the connection to the first server
fails: encode to ASCII before calling serverHashFunction.
* Fix expect(): don't decode line on Python 3, return the raw line
* Add more unit tests
* tox now also runs unit tests
* Explicit the encoding when calling str.encode(): use 'utf-8'
* test_memcache: close sockets in tearDown()
* test_get_unknown_value(): delete the key to ensure that it doesn't exist
Diffstat (limited to 'tests/test_setmulti.py')
| -rw-r--r-- | tests/test_setmulti.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/tests/test_setmulti.py b/tests/test_setmulti.py index 2f7108a..39d43c9 100644 --- a/tests/test_setmulti.py +++ b/tests/test_setmulti.py @@ -53,18 +53,20 @@ class test_Memcached_Set_Multi(unittest.TestCase): self.old_socket = socket.socket socket.socket = FakeSocket + self.mc = memcache.Client(['memcached'], debug=True) + def tearDown(self): socket.socket = self.old_socket def test_Socket_Disconnect(self): - client = memcache.Client(['memcached'], debug=True) mapping = {'foo': 'FOO', 'bar': 'BAR'} - bad_keys = client.set_multi(mapping) + bad_keys = self.mc.set_multi(mapping) self.assertEqual(sorted(bad_keys), ['bar', 'foo']) if DEBUG: print('set_multi({0!r}) -> {1!r}'.format(mapping, bad_keys)) + if __name__ == '__main__': unittest.main() |
