MCPcopy Index your code
hub / github.com/RustPython/RustPython / test_code_page_decode_flags

Method test_code_page_decode_flags

Lib/test/test_codecs.py:3510–3527  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

3508 ))
3509
3510 def test_code_page_decode_flags(self):
3511 # Issue #36312: For some code pages (e.g. UTF-7) flags for
3512 # MultiByteToWideChar() must be set to 0.
3513 if support.verbose:
3514 sys.stdout.write('\n')
3515 for cp in (50220, 50221, 50222, 50225, 50227, 50229,
3516 *range(57002, 57011+1), 65000):
3517 # On small versions of Windows like Windows IoT
3518 # not all codepages are present.
3519 # A missing codepage causes an OSError exception
3520 # so check for the codepage before decoding
3521 if is_code_page_present(cp):
3522 self.assertEqual(codecs.code_page_decode(cp, b'abc'), ('abc', 3), f'cp{cp}')
3523 else:
3524 if support.verbose:
3525 print(f" skipping cp={cp}")
3526 self.assertEqual(codecs.code_page_decode(42, b'abc'),
3527 ('\uf061\uf062\uf063', 3))
3528
3529 def test_incremental(self):
3530 decoded = codecs.code_page_decode(932, b'\x82', 'strict', False)

Callers

nothing calls this directly

Calls 4

is_code_page_presentFunction · 0.85
printFunction · 0.50
writeMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected