Add tests for pickling.
This commit is contained in:
parent
ab407b51c7
commit
732f181cb7
@ -796,8 +796,7 @@ static PyObject *_PylibMC_Pickle(PyObject *val) {
|
||||
retval = NULL;
|
||||
pickle_dump = _PylibMC_GetPickles("dumps");
|
||||
if (pickle_dump != NULL) {
|
||||
retval = PyObject_CallFunctionObjArgs(pickle_dump, val,
|
||||
PyInt_FromLong(-1), NULL);
|
||||
retval = PyObject_CallFunction(pickle_dump, "Oi", val, -1);
|
||||
Py_DECREF(pickle_dump);
|
||||
}
|
||||
|
||||
|
11
tests.py
11
tests.py
@ -105,8 +105,19 @@ True
|
||||
False
|
||||
>>> c.delete("greta")
|
||||
True
|
||||
|
||||
Complex data types!
|
||||
>>> bla = Foo()
|
||||
>>> bla.bar = "Hello!"
|
||||
>>> c.set("tengil", bla)
|
||||
True
|
||||
>>> c.get("tengil").bar == bla.bar
|
||||
True
|
||||
"""
|
||||
|
||||
# Used to test pickling.
|
||||
class Foo(object): pass
|
||||
|
||||
# Fix up sys.path so as to include the build/lib.*/ directory.
|
||||
import sys
|
||||
import os
|
||||
|
Reference in New Issue
Block a user