summaryrefslogtreecommitdiff
path: root/pymemcache/test/test_integration.py
Commit message (Collapse)AuthorAgeFilesLines
* Support for Gat and Gats, Support passing server key in a tupleMatej Spiller Muys2023-01-311-0/+31
|
* Fix key_prefix issue with stats and cache_memlimitJoe Gordon2022-10-141-28/+50
| | | | | | | Add integration tests to reproduce the issue and add an argument to _fetch_cmd to skip the key prefix logic as needed. Closes #430
* add pluggable compression serdeJohn Anderson2022-07-121-10/+77
|
* Skip test_tls until certificate is updatedJoe Gordon2022-05-311-0/+1
| | | | See https://github.com/pinterest/pymemcache/issues/396 for more details
* Apply black formattingJoe Gordon2021-12-031-111/+98
| | | | https://black.readthedocs.io/en/stable/index.html
* Remove PY2 specific imports and testsJoe Gordon2021-07-201-14/+0
| | | | | * future was needed for some python 2 specific tests * use mock from unittest.mock instead of the 3rd party mock library
* Remove six dependency and run pyupgradeJoe Gordon2021-07-201-11/+9
| | | | | | | Now that we don't require Python 2 support no need for six. Code upgraded with pyupgrade and manual fixes to remove remaining six usage.
* Fix incorrect pytest mark (#290)Jon Parise2020-08-131-1/+1
|
* Add TLS support for TCP sockets (#276)Moisés Guimarães de Medeiros2020-04-071-0/+16
|
* Fix linter errorsAli-Akber Saifee2019-12-211-0/+1
|
* Add touch method to HashClient (#263)Ali-Akber Saifee2019-12-211-0/+17
|
* Validate cas inputs as strings of digits (#250)Stephen Rosen2019-08-261-0/+5
| | | | | | | | | | | | | | | | | | | | For consideration for v3.0.0 'cas' is documented as needing to be an int or bytestring of the digits 0-9. However, this is not actually enforced and it is possible to pass a value to pymemcache which doesn't conform to these rules. In fact, you can do weird things like `cas=b'noreply'` and potentially trigger "unexpected" behavior. To go along with validating int inputs, validate cas inputs. However, these are not necessarily integers. Instead, if an int or string is given, it will be encoded as a bytestring. But in order to validate the value given, it is checked against isdigit() . (NB: You could also use `int(cas)` for very similar checking.) Rationale for allowing non-integer inputs to cas is not obvious. Presumably it allows callers using `gets()` to pass the `cas` value they get back into a `cas` command without issue. But it may be debatable.
* Change serialization interface to be an object (#245)Stephen Rosen2019-08-261-16/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Change serialization interface to be an object Rather than passing separate serialization and deserialization methods to a pymemcache client, pass an object implementing a very simple two-method interface. This is a rather significant breaking change and should be part of an x.0.0 major release. Resolves #56 As suggested in that issue, this is a cleaner interface, as there's no sensible context in which you would provide only one of these two methods and it should therefore be thought of as a serialization/deserialization protocol. Also adds a note to the documentation's Best Practices list that you should use the built-in serializer object unless you have a reason to do otherwise. * Support "de/serializer" in addition to "serde" In order to support older client usage in addition to the new serialization object (protocol), restore the "serializer" and "deserializer" arguments to the Client classes. These are marked as deprecated and will be automatically wrapped into a small "serde" object. In order to make the various object names more distinguishable and more informative, the built-in default serializer is now called "python_memcache_pickle_serde" Additionally, default client.serde to a "no-op serializer". This object does no transforms on the data. By putting this in place, we can skip some conditionals in the code around presence or absence of a serializer and therefore simplify internally (at the cost of an extra, unnecessary, functional call in some cases). It also simplifies logic around the handling of flags because we are now *guaranteed* the presence of a serializer object which returns some flags. i.e. "default flags" are no longer the responsibility of the various serializer usage sites. This is done carefully to ensure that passing a `serializer` without a `deserializer` is respected.
* Make pickle version for python_memcache_serializer adjustableJoe Gordon2018-09-071-3/+26
| | | | | | | | It's unsafe to use the max pickle version when you are switching between versions of python with different max versions. Add a new function get_python_memcache_serializer that returns a python_memcache_serializer with any pickle version.
* Fix support newbytes from futureJoe Gordon2018-09-061-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously python2 code using python-future to backport the py3 bytes behavior would trigger the following exception: code: from builtins import bytes as newbytes from pymemcache.client.base import Client client = Client(('localhost', 11211)) client.set(newbytes('key'), 'value') Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/local/lib/python2.7/site-packages/pymemcache/client/base.py", line 297, in set return self._store_cmd(b'set', key, expire, noreply, value) File "/usr/local/lib/python2.7/site-packages/pymemcache/client/base.py", line 770, in _store_cmd key = self.check_key(key) File "/usr/local/lib/python2.7/site-packages/pymemcache/client/base.py", line 251, in check_key key_prefix=self.key_prefix) File "/usr/local/lib/python2.7/site-packages/pymemcache/client/base.py", line 91, in _check_key key = key.encode('ascii') File "/usr/local/lib/python2.7/site-packages/future/types/newbytes.py", line 381, in __getattribute__ raise AttributeError("encode method has been disabled in newbytes") AttributeError: encode method has been disabled in newbytes Add a test case for this and fix.
* Ensure serde integration tests return the same typeAlex Tomkins2016-12-041-0/+1
|
* Add a few more serde integration testsAlex Tomkins2016-12-041-0/+8
| | | | | | | - A string (will vary on Python version) - Another unicode string - A list (pickled) - A defaultdict (pickled)
* Add integration test for serde serializationAlex Tomkins2016-12-041-0/+23
| | | | Currently this will fail with unicode strings on Python 3, as the pymemcache client will return a byte string - but the deserializer doesn't change it back to a unicode string.
* Fix syntax errorsNicholas Charriere2016-11-051-1/+2
|
* Add optional support for unicode keysJoe Gordon2016-11-031-13/+34
| | | | | | memcached's ASCII protocol supports unicode keys, so lets support them as well. Since using unicode keys for memcache is uncommon and to preserve the previous behavior disable support by default.
* Fix #99 unsanitized inputNicholas Charriere2016-07-271-0/+6
|
* Implemented the other functions and added testsJohn Anderson2015-06-201-17/+16
|
* Initial implementation of the hash clientJohn Anderson2015-06-201-2/+5
|
* flake8 the testsJohn Anderson2015-06-201-4/+1
|
* Finished porting integration tests to pytestJohn Anderson2015-06-191-0/+246