mirror of
https://github.com/dobin/avred
synced 2026-06-08 13:54:13 +00:00
16 lines
391 B
Python
16 lines
391 B
Python
import unittest
|
|
from model.file_model import BaseFile
|
|
|
|
|
|
class ModelTest(unittest.TestCase):
|
|
def testFile(self):
|
|
file = BaseFile()
|
|
orig = b'AAAABBBBCCCCDDDD'
|
|
new = b'AA\x00\x00\x00\x00BBCCCCDDDD'
|
|
|
|
file.loadFromMem(orig, "test.bin")
|
|
file.Data().hidePart(offset=2, size=4)
|
|
|
|
patched = file.DataAsBytes()
|
|
self.assertEqual(patched, new)
|