4 # Author: Günter Milde <milde@users.sourceforge.net>
5 # Copyright: This module has been placed in the public domain.
8 Test module for the command line.
14 import DocutilsTestSupport
# must be imported before docutils
20 argv_encoding
= locale
.getpreferredencoding()
25 <document source="<stdin>" title="Dornröschen">
31 class CommandLineEncodingTests(unittest
.TestCase
):
33 # This does not work, as there is no "encoding" argument!
34 # def test_argv_encoding(self):
35 # if argv_encoding is None:
36 # # failure to load "locale" module
39 # self.assertEqual(sys.argv[0].encoding,
40 # locale.getpreferredencoding())
42 def test_argv_decoding(self
):
43 if argv_encoding
is None:
44 # failure to load "locale" module
45 return # nothing to test
46 cmd_str
= (u
'../tools/rst2pseudoxml.py --no-generator '
47 u
'--no-datestamp --title=Dornröschen')
48 output
= os
.popen(cmd_str
.encode(argv_encoding
)).read()
50 self
.assertEqual(output
, testoutput
)
53 if __name__
== '__main__':