Skip to content

Commit d0e2a2b

Browse files
committed
Test 13 more encodings
1 parent 981a994 commit d0e2a2b

1 file changed

Lines changed: 35 additions & 1 deletion

File tree

‎tests/hypothesis_tests.py‎

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -560,10 +560,44 @@ def test_shx_reader_writer_roundtrip(codes_and_shapes)-> None:
560560
"utf-16",
561561
"utf-32-be",
562562
"utf-32-le",
563+
"cp1252",
564+
"cp1254",
565+
"cp932",
566+
"euc_kr",
567+
"euc_jp",
568+
"mac_iceland",
569+
"cp932",
570+
"shift_jis",
571+
"iso8859_5",
572+
"koi8_r",
573+
"gbk",
574+
"gb18030",
575+
"big5",
563576
]
564-
565577
encodings = sampled_from(ENCODINGS)
566578

579+
# from encodings.aliases import aliases
580+
# encs = set()
581+
# for enc in aliases.values():
582+
# if enc in encs:
583+
# continue
584+
# try:
585+
# "".encode(enc)
586+
# except UnicodeEncodeError, LookupError:
587+
# continue
588+
# encs.add(enc)
589+
# assert encs == ['utf_16_le', 'iso8859_7', 'cp437', 'iso2022_jp_3', 'shift_jis', 'cp775', 'cp1140',
590+
# 'cp861', 'iso8859_11', 'iso8859_9', 'euc_jp', 'utf_16', 'cp950', 'mac_cyrillic', 'mac_turkish', 'iso2022_jp_1', 'iso8859_10',
591+
# 'iso2022_jp_2004', 'cp866', 'mac_greek', 'hz', 'cp1257', 'cp037', 'cp863', 'iso8859_4', 'utf_16_be', 'gb18030', 'cp1250',
592+
# 'cp850', 'iso8859_5', 'shift_jisx0213', 'iso8859_8', 'cp273', 'euc_jisx0213', 'cp932', 'cp862', 'tis_620', 'cp1125', 'koi8_r',
593+
# 'cp874', 'cp1026', 'cp1252', 'cp858', 'cp865', 'gb2312', 'iso8859_15', 'cp857', 'cp860', 'iso2022_jp', 'iso2022_jp_ext',
594+
# 'ascii', 'cp1254', 'cp424', 'cp855', 'hp_roman8', 'mac_latin2', 'euc_jis_2004', 'euc_kr', 'cp1256', 'shift_jis_2004',
595+
# 'utf_32_le', 'gbk', 'cp869', 'iso8859_13', 'iso8859_3', 'big5', 'cp1258', 'cp1253', 'latin_1', 'cp864', 'utf_8',
596+
# 'iso2022_kr', 'cp1251', 'cp1255', 'mac_iceland', 'kz1048', 'iso8859_14', 'utf_32_be', 'ptcp154', 'iso8859_6', 'mac_roman',
597+
# 'utf_32', 'iso2022_jp_2', 'iso8859_16', 'mbcs', 'cp500', 'iso8859_2', 'cp949', 'cp852', 'utf_7', 'big5hkscs', 'johab']
598+
599+
# encodings = sampled_from(list(encs))
600+
567601

568602
@composite
569603
def _dbf_fields_strategy(draw, encoding: str) -> dict[str, str | int]:

0 commit comments

Comments
 (0)