HISTORY summary
[docutils.git] / test / test_pickle.py
blobb1a987f16103404499c2285616c4e21e5b7289a5
1 #! /usr/bin/env python
2 # $Id$
3 # Author: David Goodger <goodger@python.org>
4 # Copyright: This module has been placed in the public domain.
6 """
7 Tests of document tree pickling.
8 """
10 import unittest
11 import DocutilsTestSupport # must be imported before docutils
12 import pickle
13 from docutils import core
16 class PickleTests(unittest.TestCase):
18 def test_pickle(self):
19 doctree = core.publish_doctree(
20 source='Title\n=====\n\nparagraph\n',
21 settings_overrides={'_disable_config': True})
22 dill = pickle.dumps(doctree)
23 reconstituted = pickle.loads(dill)
24 self.assertEqual(doctree.pformat(), reconstituted.pformat())
27 if __name__ == '__main__':
28 unittest.main()