diff test/testhexfile.py @ 292:534b94b40aa8

Fixup reorganize
author Windel Bouwman
date Wed, 27 Nov 2013 08:06:42 +0100
parents 05184b95fa16
children e609d5296ee9
line wrap: on
line diff
--- a/test/testhexfile.py	Sun Nov 24 11:24:15 2013 +0100
+++ b/test/testhexfile.py	Wed Nov 27 08:06:42 2013 +0100
@@ -1,6 +1,6 @@
 import unittest
 import io
-from hexfile import HexFile, HexFileException
+from utils import HexFile, HexFileException
 
 
 class testHexFile(unittest.TestCase):
@@ -38,6 +38,15 @@
         hf.addRegion(0xF003, bytes.fromhex('ab')*0x10000)
         self.saveload(hf)
 
+    def testTwoRegions(self):
+        hf = HexFile()
+        hf2 = HexFile()
+        hf.addRegion(0x100, bytes.fromhex('abcd'))
+        hf.addRegion(0x200, bytes.fromhex('beef'))
+        hf2.addRegion(0x200, bytes.fromhex('beef'))
+        hf2.addRegion(0x100, bytes.fromhex('abcd'))
+        self.assertEqual(hf, hf2)
+
     def testMerge(self):
         hf = HexFile()
         hf.addRegion(0x10, bytes.fromhex('abcdab'))
@@ -74,9 +83,7 @@
 
     def testLoad(self):
         hf = HexFile()
-        dummyhex = """
-        :01400000aa15
-        """
+        dummyhex = """:01400000aa15"""
         f = io.StringIO(dummyhex)
         hf.load(f)
         self.assertEqual(1, len(hf.regions))
@@ -99,4 +106,3 @@
 
 if __name__ == '__main__':
     unittest.main()
-