summaryrefslogtreecommitdiff
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* Allow keys to be encoded before use.Sean Reifschneider2023-04-181-0/+27
| | | | | | | | | | Ported patch in #52 from @harlowja to current branch. Added tests. For the cases where the user wants to transparently encode keys (say using urllib) before they are used further allow a encoding function to be passed in that will perform these types of activities (by default it is the identity function).
* Adding test for quit_allSean Reifschneider2023-04-161-0/+3
|
* Removing "time" from delete and making expiry mandatory in touch.Sean Reifschneider2023-04-161-1/+1
| | | | | | | | | | | | Port of erankor's PR #30 to the latest code. In that PR, the "time" argument to delete() is removed because it is not supported by the protocol: https://github.com/memcached/memcached/blob/master/doc/protocol.txt#L330 And touch requires the expiry parameter due to protocol: https://github.com/memcached/memcached/blob/master/doc/protocol.txt#L399
* Merge branch 'master' into support_defaultSean Reifschneider2023-04-151-1/+4
|\
| * test_memcache.py: try import unittest.mockTim Orling2019-12-151-1/+4
| | | | | | | | | | | | | | Rather than always require the separate mock module, try to use unittest.mock if it is available Signed-off-by: Tim Orling <ticotimo@gmail.com>
* | Add support for default value in getJakub Szafrański2019-02-121-0/+14
|/
* Fix touch(..., time=0) sending invalid command to memcacheNicolas Noé2017-11-211-0/+7
| | | | Without the trailing '0', the command is invalid.
* Add test isolation by clearing memcache between each testTim Graham2017-11-211-1/+3
|
* Fix delete_multi() argument in a testKris Maglione2017-11-141-1/+1
|
* Removed unnecessary six usage in testsTim Graham2017-11-141-2/+1
|
* Fix #79, #80 -- Fix storing non-ASCII values on Python 2 and binary values ↵Nicolas Noé2017-11-141-0/+28
| | | | on Python 3
* Fix crash on Python 3 in touch() loggingMatt Davis2017-11-141-1/+13
|
* Capture and verify logging in testsTim Graham2017-11-144-7/+56
|
* #112 Cleaning up flake8 alertsSean Reifschneider2016-12-172-3/+3
|
* Remove unused _has_unicode/_str_cls varsTim Graham2016-12-161-11/+0
| | | | Unused since 04f1c78c13bd54050b1d2d3baa9e86d9e79b3629.
* Changing assertIs from last patch to assertTrue.Sean Reifschneider2015-08-021-1/+1
|
* Fixing tests for PEP8.Sean Reifschneider2015-08-021-2/+0
|
* Adding unittest backport to 2.6.Sean Reifschneider2015-08-021-1/+1
|
* Merge branch 'py3' of ssh://github.com/haypo/python-memcached into haypo-py3Sean Reifschneider2015-08-022-80/+65
|\ | | | | | | | | Conflicts: tests/test_memcache.py
| * More Python 3 fixesVictor Stinner2015-07-272-78/+61
| | | | | | | | | | | | | | | | | | | | | | | | | | * 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
* | Test for set/get boolean values.Nicholas Serra2015-07-311-0/+3
|/
* Port memcache to Python 3Victor Stinner2015-04-232-3/+5
| | | | | | | | | | | | | | | | | | * travis: make python 3 tests voting (cannot fail anymore) * setup.py: add Python 3 classifiers * Encode unicode key to UTF-8: add _encode_key() method * Add _encode_cmd() helper method to format a memcache command as a byte string (bytes%args will only be supported in Python 3.5) * Rewrite _map_and_prefix_keys() code converting keys * _val_to_store_info() now accepts Unicode: Unicode is encoded to UTF-8 * _set('cas') doesn't call _val_to_store_info() anymore when it's not needed: begin by checking if the key is in the cas_ids dictionary * Process server reply as bytes * _recv_value() now clears the _FLAG_COMPRESSED flag after decompressing to simplify the code * On Python 3, _recv_value() now decodes byte strings from UTF-8 * Simplify check_key(), _encode_key() now encodes Unicode to UTF-8 * Replace u'...' with six.u('...') in tests for Python 3.2
* Copy memcache.py tests into a proper test case.Jeremy Thurgood2014-10-141-0/+196
|
* pep8: E265 block comment should start with '# 'Marc Abramowitz2014-06-091-1/+1
|
* Sort imports for pep8Marc Abramowitz2014-06-091-2/+2
|
* Merge branch 'master' into print-stmt-py3kAlex Gaynor2014-05-101-7/+0
|\
| * Merge branch 'tox_support' of https://github.com/cabrera/python-memcached ↵Sean Reifschneider2014-05-101-7/+0
| |\ | | | | | | | | | | | | | | | | | | | | | into cabrera-tox_support Conflicts: README.md tests/test_setmulti.py
| | * feat(tox): add support for testing with toxAlejandro Cabrera2014-01-152-9/+0
| | | | | | | | | | | | | | | | | | | | | | | | This adds notes in the README and a tox.ini file for use with the tox test manager. This helps greatly towards migrating python-memcached towards python 3.3+ compatibility.
* | | Converted print statements to use the Python3 compatible formAlex Gaynor2014-05-101-6/+8
|/ /
* | Wrapping the unit-test main in if __name__.Sean Reifschneider2014-03-251-0/+3
| | | | | | | | a Please enter the commit message for your changes. Lines starting
* | tests/test_setmulti.py: Remove `unittest.main()`Marc Abramowitz2014-03-251-2/+0
|/
* Fixing AttributeError raised during set_multi.Sean Reifschneider2013-06-021-1/+1
|
* Adding a test for set_multi submitted by Ben Hoyt.Sean Reifschneider2013-06-022-0/+74