diff options
| author | wiemann <wiemann@929543f6-e4f2-0310-98a6-ba3bd3dd1d04> | 2005-08-17 13:59:12 +0000 |
|---|---|---|
| committer | wiemann <wiemann@929543f6-e4f2-0310-98a6-ba3bd3dd1d04> | 2005-08-17 13:59:12 +0000 |
| commit | a4bc0d09f3d1f633a5780976d1f913e083c9564a (patch) | |
| tree | 1777475e88463b08438f0719be97cc087554eadd /test/test_io.py | |
| parent | 60c69f8cf97125135948a3d35b7698ee80921137 (diff) | |
| parent | 2818db9a234cc37008c5f2bb0e821f9b1fa92de2 (diff) | |
| download | docutils-0.3.9.tar.gz | |
re-added docutils-0.3.9 tag one level deeper (without web/ and sandboxes/)docutils-0.3.9
git-svn-id: http://svn.code.sf.net/p/docutils/code/tags/docutils-0.3.9@3815 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
Diffstat (limited to 'test/test_io.py')
| -rwxr-xr-x | test/test_io.py | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/test/test_io.py b/test/test_io.py new file mode 100755 index 000000000..e65b05c6c --- /dev/null +++ b/test/test_io.py @@ -0,0 +1,31 @@ +#! /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 +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() |
