3535@pytest .mark .parametrize (
3636 "container" ,
3737 [
38- Container (
39- name = "single_code_section_with_data_section" ,
40- sections = [
41- Section .Code (code = Op .STOP ),
42- Section .Data (data = "0x00" ),
43- ],
44- ),
4538 Container (
4639 name = "single_code_section_max_stack_size" ,
4740 sections = [
@@ -181,37 +174,30 @@ def test_valid_containers(
181174 ),
182175 Container (
183176 name = "incomplete_magic" ,
184- raw_bytes = bytes ([ 0xEF ]) ,
177+ raw_bytes = "ef" ,
185178 validity_error = EOFException .INVALID_MAGIC ,
186179 ),
187180 Container (
188181 name = "no_version" ,
189- raw_bytes = bytes ([ 0xEF , 0x00 ]) ,
182+ raw_bytes = "ef00" ,
190183 validity_error = [EOFException .INVALID_VERSION , EOFException .INVALID_MAGIC ],
191184 ),
192185 Container (
193186 name = "no_type_header" ,
194- raw_bytes = bytes ([0xEF , 0x00 , 0x01 ]),
195- # TODO the exception must be about missing section types
187+ raw_bytes = "ef00 01" ,
196188 validity_error = EOFException .MISSING_HEADERS_TERMINATOR ,
197189 ),
198190 Container (
199191 name = "no_type_section_size" ,
200- raw_bytes = bytes (
201- [0xEF , 0x00 , 0x01 , 0x01 ],
202- ),
203- # TODO the exception must be about incomplete section in the header
192+ raw_bytes = "ef00 01 01" ,
204193 validity_error = [
205194 EOFException .MISSING_HEADERS_TERMINATOR ,
206195 EOFException .INVALID_TYPE_SECTION_SIZE ,
207196 ],
208197 ),
209198 Container (
210199 name = "incomplete_type_section_size" ,
211- raw_bytes = bytes (
212- [0xEF , 0x00 , 0x01 , 0x01 , 0x00 ],
213- ),
214- # TODO the exception must be about incomplete section in the header
200+ raw_bytes = "ef00010100" ,
215201 validity_error = [
216202 EOFException .INCOMPLETE_SECTION_SIZE ,
217203 EOFException .INVALID_TYPE_SECTION_SIZE ,
@@ -242,7 +228,7 @@ def test_valid_containers(
242228 ),
243229 Container (
244230 name = "code_section_count_incomplete" ,
245- raw_bytes = bytes ([ 0xEF , 0x00 , 0x01 , 0x01 , 0x00 , 0x04 , 0x02 , 0x00 ]) ,
231+ raw_bytes = "ef00 01 01 0004 02 00" ,
246232 validity_error = EOFException .INCOMPLETE_SECTION_NUMBER ,
247233 ),
248234 Container (
@@ -255,7 +241,7 @@ def test_valid_containers(
255241 ),
256242 Container (
257243 name = "code_section_size_incomplete" ,
258- raw_bytes = bytes ([ 0xEF , 0x00 , 0x01 , 0x01 , 0x00 , 0x04 , 0x02 , 0x00 , 0x01 , 0x00 ]) ,
244+ raw_bytes = "ef00 01 01 0004 02 0001 00" ,
259245 validity_error = [EOFException .INCOMPLETE_SECTION_SIZE , EOFException .ZERO_SECTION_SIZE ],
260246 ),
261247 Container (
@@ -1059,21 +1045,6 @@ def test_valid_containers(
10591045 ],
10601046 validity_error = EOFException .INPUTS_OUTPUTS_NUM_ABOVE_LIMIT ,
10611047 ),
1062- Container (
1063- name = "code_section_output_too_large_2" ,
1064- sections = [
1065- Section .Code (
1066- code = Op .JUMPF [1 ],
1067- ),
1068- Section .Code (
1069- code = (Op .PUSH0 * (MAX_CODE_OUTPUTS + 1 )) + Op .RETF ,
1070- code_inputs = 0 ,
1071- code_outputs = (MAX_CODE_OUTPUTS + 1 ),
1072- max_stack_height = (MAX_CODE_OUTPUTS + 1 ),
1073- ),
1074- ],
1075- validity_error = EOFException .INVALID_NON_RETURNING_FLAG ,
1076- ),
10771048 Container (
10781049 name = "single_code_section_max_stack_size_too_large" ,
10791050 sections = [
@@ -1113,6 +1084,8 @@ def test_magic_validation(
11131084 """
11141085 Verify EOF container 2-byte magic
11151086 """
1087+ if magic_0 == 0xEF and magic_1 == 0 :
1088+ pytest .skip ("Valid magic" )
11161089 code = bytearray (bytes (VALID_CONTAINER ))
11171090 code [0 ] = magic_0
11181091 code [1 ] = magic_1
@@ -1130,6 +1103,8 @@ def test_version_validation(
11301103 """
11311104 Verify EOF container version
11321105 """
1106+ if version == 1 :
1107+ pytest .skip ("Valid version" )
11331108 code = bytearray (bytes (VALID_CONTAINER ))
11341109 code [2 ] = version
11351110 eof_test (
0 commit comments