Ejemplo n.º 1
0
 def testFormatNonAsciiMarkerStringAllAscii(self):
     self.term_size_mock.return_value = (80, 80)
     args = ['command', '--foo', 'bar']
     with self.assertRaisesRegex(
             ValueError, r'The command line is composed entirely of ASCII '
             r'characters\.'):
         exceptions._FormatNonAsciiMarkerString(args)
Ejemplo n.º 2
0
 def testFormatNonAsciiMarkerStringReallySmallScreen(self):
     # 10 < len('^ invalid character')
     self.term_size_mock.return_value = (10, 80)
     args = ['command', '--foo', b'\xce\x94']
     marker_string = exceptions._FormatNonAsciiMarkerString(args)
     self.assertEqual(marker_string, ('command --foo \\u0394\n'
                                      '              ^ invalid character'))