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.
13 import DocutilsTestSupport
# must be imported before docutils
17 import subprocess
# new in 2.4
22 argv_encoding
= locale
.getpreferredencoding()
26 class CommandLineEncodingTests(unittest
.TestCase
):
28 def test_sys_argv_decoding(self
):
29 if argv_encoding
is None: # cannot test
31 sys
.argv
.append(u
'--title=Dornröschen'.encode(argv_encoding
))
32 publisher
= docutils
.core
.Publisher()
33 publisher
.process_command_line()
34 self
.assertEqual(publisher
.settings
.title
, u
'Dornröschen')
37 if __name__
== '__main__':