@@ -1174,43 +1174,43 @@ def test_finalize_dict_arguments(self):
11741174 def test_train_dict_c (self ):
11751175 # argument wrong type
11761176 with self .assertRaises (TypeError ):
1177- _zstd ._train_dict ({}, (), 100 )
1177+ _zstd .train_dict ({}, (), 100 )
11781178 with self .assertRaises (TypeError ):
1179- _zstd ._train_dict (b'' , 99 , 100 )
1179+ _zstd .train_dict (b'' , 99 , 100 )
11801180 with self .assertRaises (TypeError ):
1181- _zstd ._train_dict (b'' , (), 100.1 )
1181+ _zstd .train_dict (b'' , (), 100.1 )
11821182
11831183 # size > size_t
11841184 with self .assertRaises (ValueError ):
1185- _zstd ._train_dict (b'' , (2 ** 64 + 1 ,), 100 )
1185+ _zstd .train_dict (b'' , (2 ** 64 + 1 ,), 100 )
11861186
11871187 # dict_size <= 0
11881188 with self .assertRaises (ValueError ):
1189- _zstd ._train_dict (b'' , (), 0 )
1189+ _zstd .train_dict (b'' , (), 0 )
11901190
11911191 def test_finalize_dict_c (self ):
11921192 with self .assertRaises (TypeError ):
1193- _zstd ._finalize_dict (1 , 2 , 3 , 4 , 5 )
1193+ _zstd .finalize_dict (1 , 2 , 3 , 4 , 5 )
11941194
11951195 # argument wrong type
11961196 with self .assertRaises (TypeError ):
1197- _zstd ._finalize_dict ({}, b'' , (), 100 , 5 )
1197+ _zstd .finalize_dict ({}, b'' , (), 100 , 5 )
11981198 with self .assertRaises (TypeError ):
1199- _zstd ._finalize_dict (TRAINED_DICT .dict_content , {}, (), 100 , 5 )
1199+ _zstd .finalize_dict (TRAINED_DICT .dict_content , {}, (), 100 , 5 )
12001200 with self .assertRaises (TypeError ):
1201- _zstd ._finalize_dict (TRAINED_DICT .dict_content , b'' , 99 , 100 , 5 )
1201+ _zstd .finalize_dict (TRAINED_DICT .dict_content , b'' , 99 , 100 , 5 )
12021202 with self .assertRaises (TypeError ):
1203- _zstd ._finalize_dict (TRAINED_DICT .dict_content , b'' , (), 100.1 , 5 )
1203+ _zstd .finalize_dict (TRAINED_DICT .dict_content , b'' , (), 100.1 , 5 )
12041204 with self .assertRaises (TypeError ):
1205- _zstd ._finalize_dict (TRAINED_DICT .dict_content , b'' , (), 100 , 5.1 )
1205+ _zstd .finalize_dict (TRAINED_DICT .dict_content , b'' , (), 100 , 5.1 )
12061206
12071207 # size > size_t
12081208 with self .assertRaises (ValueError ):
1209- _zstd ._finalize_dict (TRAINED_DICT .dict_content , b'' , (2 ** 64 + 1 ,), 100 , 5 )
1209+ _zstd .finalize_dict (TRAINED_DICT .dict_content , b'' , (2 ** 64 + 1 ,), 100 , 5 )
12101210
12111211 # dict_size <= 0
12121212 with self .assertRaises (ValueError ):
1213- _zstd ._finalize_dict (TRAINED_DICT .dict_content , b'' , (), 0 , 5 )
1213+ _zstd .finalize_dict (TRAINED_DICT .dict_content , b'' , (), 0 , 5 )
12141214
12151215 def test_train_buffer_protocol_samples (self ):
12161216 def _nbytes (dat ):
@@ -1232,19 +1232,19 @@ def _nbytes(dat):
12321232 # wrong size list
12331233 with self .assertRaisesRegex (ValueError ,
12341234 "The samples size tuple doesn't match the concatenation's size" ):
1235- _zstd ._train_dict (concatenation , tuple (wrong_size_lst ), 100 * _1K )
1235+ _zstd .train_dict (concatenation , tuple (wrong_size_lst ), 100 * _1K )
12361236
12371237 # correct size list
1238- _zstd ._train_dict (concatenation , tuple (correct_size_lst ), 3 * _1K )
1238+ _zstd .train_dict (concatenation , tuple (correct_size_lst ), 3 * _1K )
12391239
12401240 # wrong size list
12411241 with self .assertRaisesRegex (ValueError ,
12421242 "The samples size tuple doesn't match the concatenation's size" ):
1243- _zstd ._finalize_dict (TRAINED_DICT .dict_content ,
1243+ _zstd .finalize_dict (TRAINED_DICT .dict_content ,
12441244 concatenation , tuple (wrong_size_lst ), 300 * _1K , 5 )
12451245
12461246 # correct size list
1247- _zstd ._finalize_dict (TRAINED_DICT .dict_content ,
1247+ _zstd .finalize_dict (TRAINED_DICT .dict_content ,
12481248 concatenation , tuple (correct_size_lst ), 300 * _1K , 5 )
12491249
12501250 def test_as_prefix (self ):
@@ -1682,10 +1682,10 @@ def test_read_incomplete(self):
16821682
16831683 # Trailing data isn't a valid compressed stream
16841684 with ZstdFile (io .BytesIO (self .FRAME_42 + b'12345' )) as f :
1685- self .assertEqual ( f . read (), self . DECOMPRESSED_42 )
1685+ self .assertRaises ( ZstdError , f . read )
16861686
16871687 with ZstdFile (io .BytesIO (SKIPPABLE_FRAME + b'12345' )) as f :
1688- self .assertEqual ( f .read (), b'' )
1688+ self .assertRaises ( ZstdError , f .read )
16891689
16901690 def test_read_truncated (self ):
16911691 # Drop stream epilogue: 4 bytes checksum
0 commit comments