diff options
author | wiemann <wiemann@929543f6-e4f2-0310-98a6-ba3bd3dd1d04> | 2006-01-09 20:44:25 +0000 |
---|---|---|
committer | wiemann <wiemann@929543f6-e4f2-0310-98a6-ba3bd3dd1d04> | 2006-01-09 20:44:25 +0000 |
commit | d77fdfef70e08114f57cbef5d91707df8717ea9f (patch) | |
tree | 49444e3486c0c333cb7b33dfa721296c08ee4ece /test/test_io.py | |
parent | 53cd16ca6ca5f638cbe5956988e88f9339e355cf (diff) | |
parent | 3993c4097756e9885bcfbd07cb1cc1e4e95e50e4 (diff) | |
download | docutils-0.4.tar.gz |
Release 0.4: tagging released revisiondocutils-0.4
git-svn-id: http://svn.code.sf.net/p/docutils/code/tags/docutils-0.4@4268 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
Diffstat (limited to 'test/test_io.py')
-rwxr-xr-x | test/test_io.py | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/test/test_io.py b/test/test_io.py new file mode 100755 index 000000000..b82911e44 --- /dev/null +++ b/test/test_io.py @@ -0,0 +1,32 @@ +#! /usr/bin/env python + +# Author: Felix Wiemann +# Contact: Felix_Wiemann@ososo.de +# Revision: $Revision$ +# Date: $Date$ +# Copyright: This module has been placed in the public domain. + +""" +Test module for io.py. +""" + +import unittest +import DocutilsTestSupport # must be imported before docutils +from docutils import io + + +class InputTests(unittest.TestCase): + + def test_bom(self): + input = io.StringInput(source='\xef\xbb\xbf foo \xef\xbb\xbf bar', + encoding='utf8') + # Assert BOMs are gone. + self.assertEquals(input.read(), u' foo bar') + # With unicode input: + input = io.StringInput(source=u'\ufeff foo \ufeff bar') + # Assert BOMs are still there. + self.assertEquals(input.read(), u'\ufeff foo \ufeff bar') + + +if __name__ == '__main__': + unittest.main() |