Пример #1
0
 def test_utf8_unicode(self):
     stdout = Mock(encoding='latin-1')
     cfg = config.Config(stdout=stdout)
     cfg.print_stdout(compat.u("méil %s %s"), "x", "y")
     eq_(stdout.mock_calls,
         [call.write(compat.u('méil x y')),
          call.write('\n')])
Пример #2
0
 def test_utf8_unicode(self):
     stdout = Mock(encoding='latin-1')
     cfg = config.Config(stdout=stdout)
     cfg.print_stdout(compat.u("méil %s %s"), "x", "y")
     eq_(
         stdout.mock_calls,
         [call.write(compat.u('méil x y')), call.write('\n')]
     )
Пример #3
0
 def test_plain(self):
     stdout = Mock(encoding='latin-1')
     cfg = config.Config(stdout=stdout)
     cfg.print_stdout("test %s %s", "x", "y")
     eq_(
         stdout.mock_calls,
         [call.write('test x y'), call.write('\n')]
     )
Пример #4
0
 def test_ascii_unicode(self):
     stdout = Mock(encoding=None)
     cfg = config.Config(stdout=stdout)
     cfg.print_stdout(compat.u("méil %s %s"), "x", "y")
     eq_(
         stdout.mock_calls,
         [call.write('m?il x y'), call.write('\n')]
     )
Пример #5
0
 def test_ascii_unicode(self):
     stdout = Mock(encoding=None)
     cfg = config.Config(stdout=stdout)
     cfg.print_stdout(compat.u("méil %s %s"), "x", "y")
     eq_(
         stdout.mock_calls,
         [call.write('m?il x y'), call.write('\n')]
     )
Пример #6
0
 def test_plain(self):
     stdout = Mock(encoding='latin-1')
     cfg = config.Config(stdout=stdout)
     cfg.print_stdout("test %s %s", "x", "y")
     eq_(
         stdout.mock_calls,
         [call.write('test x y'), call.write('\n')]
     )
Пример #7
0
 def test_only_formats_output_with_args(self):
     stdout = Mock(encoding=None)
     cfg = config.Config(stdout=stdout)
     cfg.print_stdout(compat.u("test 3%"))
     eq_(stdout.mock_calls, [call.write("test 3%"), call.write("\n")])
Пример #8
0
 def test_plain(self):
     stdout = Mock(encoding="latin-1")
     cfg = config.Config(stdout=stdout)
     cfg.print_stdout("test %s %s", "x", "y")
     eq_(stdout.mock_calls, [call.write("test x y"), call.write("\n")])
Пример #9
0
 def test_only_formats_output_with_args(self):
     stdout = Mock(encoding=None)
     cfg = config.Config(stdout=stdout)
     cfg.print_stdout(compat.u("test 3%"))
     eq_(stdout.mock_calls, [call.write("test 3%"), call.write("\n")])
Пример #10
0
 def test_plain(self):
     stdout = Mock(encoding="latin-1")
     cfg = config.Config(stdout=stdout)
     cfg.print_stdout("test %s %s", "x", "y")
     eq_(stdout.mock_calls, [call.write("test x y"), call.write("\n")])