diff options
| author | goodger <goodger@929543f6-e4f2-0310-98a6-ba3bd3dd1d04> | 2006-04-02 06:27:33 +0000 |
|---|---|---|
| committer | goodger <goodger@929543f6-e4f2-0310-98a6-ba3bd3dd1d04> | 2006-04-02 06:27:33 +0000 |
| commit | a5d3129cd03ea68b4460da9103c0d104f427b01c (patch) | |
| tree | 222b70e985d7f94fad7e870450914548c25f0455 /docutils/test/test_pickle.py | |
| parent | f52e891675d405eb4f7b1738265e47dc46259a62 (diff) | |
| download | docutils-a5d3129cd03ea68b4460da9103c0d104f427b01c.tar.gz | |
Added ``docutils.nodes.document.__getstate__`` method, for pickling.
git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk@4487 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
Diffstat (limited to 'docutils/test/test_pickle.py')
| -rwxr-xr-x | docutils/test/test_pickle.py | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/docutils/test/test_pickle.py b/docutils/test/test_pickle.py new file mode 100755 index 000000000..f4b5c249f --- /dev/null +++ b/docutils/test/test_pickle.py @@ -0,0 +1,30 @@ +#! /usr/bin/env python +# Author: David Goodger +# Contact: goodger@python.org +# Revision: $Revision$ +# Date: $Date$ +# Copyright: This module has been placed in the public domain. + +""" +Tests of document tree pickling. +""" + +import unittest +import DocutilsTestSupport # must be imported before docutils +import pickle +from docutils import core + + +class PickleTests(unittest.TestCase): + + def test_pickle(self): + doctree = core.publish_doctree( + source='Title\n=====\n\nparagraph\n', + settings_overrides={'_disable_config': 1}) + dill = pickle.dumps(doctree) + reconstituted = pickle.loads(dill) + self.assertEquals(doctree.pformat(), reconstituted.pformat()) + + +if __name__ == '__main__': + unittest.main() |
