deftest_eof_example_custom_fields(eof_test:EOFTestFiller):"""Example of python EOF container class tuning."""# if you need to overwrite certain structure bytes, you can use customization# this is useful for unit testing the eof structure format, you can reorganize sections# and overwrite the header bytes for testing purposes# most of the combinations are covered by the unit tests# This features are subject for development and will change in the futureeof_code=Container(name="valid_container_example_2",magic=b"\xef\x00",# magic can be overwritten for test purposes, (default is 0xEF00)version=b"\x01",# version can be overwritten for testing purposes (default is 0x01)header_terminator=b"\x00",# terminator byte can be overwritten (default is 0x00)extra=b"",# extra bytes to be trailed after the container body bytes (default is None)sections=[# TYPES section is constructed automatically based on CODE# CODE sectionSection.Code(code=Op.PUSH1(2)+Op.STOP,# this is the actual bytecode to be deployed in the bodymax_stack_height=1,# define code header (in body) stack size),# DATA sectionSection.Data(data="0xef",# custom_size overrides the size bytes, so you can put only 1 byte into data# but still make the header size of 2 to produce invalid section# if custom_size != len(data), the section will be invalidcustom_size=1,),],# auto generate types section based on provided code sections# AutoSection.ONLY_BODY - means the section will be generated only for the body bytes# AutoSection.ONLY_BODY - means the section will be generated only for the header bytesauto_type_section=AutoSection.AUTO,# auto generate default data section (0x empty), by default is Trueauto_data_section=True,# auto sort section by order 01 02 03 04# AutoSection.ONLY_BODY - means the sorting will be done only for the body bytes# AutoSection.ONLY_BODY - means the section will be done only for the header bytesauto_sort_sections=AutoSection.AUTO,)eof_test(container=eof_code,expect_exception=eof_code.validity_error,)