Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 35 additions & 1 deletion tests/hypothesis_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -560,10 +560,44 @@ def test_shx_reader_writer_roundtrip(codes_and_shapes)-> None:
"utf-16",
"utf-32-be",
"utf-32-le",
"cp1252",
"cp1254",
"cp932",
"euc_kr",
"euc_jp",
"mac_iceland",
"cp932",
"shift_jis",
"iso8859_5",
"koi8_r",
"gbk",
"gb18030",
"big5",
]

encodings = sampled_from(ENCODINGS)

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

# encodings = sampled_from(list(encs))


@composite
def _dbf_fields_strategy(draw, encoding: str) -> dict[str, str | int]:
Expand Down
Loading