import struct import unittest from helpers import FIXTURE from nxhmi.container import (BACKUP_TABLE_OFFSET, DATA_OFFSET, MARKER_OFFSET, VERSION_MAGIC, VERSION_OFFSET, HMIError, HMIFile, build) class Container(unittest.TestCase): def test_build_layout(self): f = build([("a.bin", b"hello"), ("b.bin", b"world!")]) raw = f.to_bytes() self.assertEqual(raw[VERSION_OFFSET:VERSION_OFFSET + 8], VERSION_MAGIC) self.assertEqual(struct.unpack_from("