(self)
| 1164 | self.assertEqual(output, result_2004_text.encode('utf-16-le')) |
| 1165 | |
| 1166 | def test_option_locale(self): |
| 1167 | self.assertFailure('-L') |
| 1168 | self.assertFailure('--locale') |
| 1169 | self.assertFailure('-L', 'en') |
| 1170 | |
| 1171 | lang, enc = locale.getlocale() |
| 1172 | lang = lang or 'C' |
| 1173 | enc = enc or 'UTF-8' |
| 1174 | try: |
| 1175 | oldlocale = locale.getlocale(locale.LC_TIME) |
| 1176 | try: |
| 1177 | locale.setlocale(locale.LC_TIME, (lang, enc)) |
| 1178 | finally: |
| 1179 | locale.setlocale(locale.LC_TIME, oldlocale) |
| 1180 | except (locale.Error, ValueError): |
| 1181 | self.skipTest('cannot set the system default locale') |
| 1182 | for run in self.runners: |
| 1183 | for type in ('text', 'html'): |
| 1184 | output = run( |
| 1185 | '--type', type, '--locale', lang, '--encoding', enc, '2004' |
| 1186 | ) |
| 1187 | self.assertIn('2004'.encode(enc), output) |
| 1188 | |
| 1189 | def test_option_width(self): |
| 1190 | self.assertFailure('-w') |
nothing calls this directly
no test coverage detected