Skip to content

Commit

Permalink
Additional set/get unit tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
eerimoq committed Nov 14, 2017
1 parent bb053d7 commit d559b29
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tests/test_bincopy.py
Original file line number Diff line number Diff line change
Expand Up @@ -479,9 +479,13 @@ def test_set_get_item(self):

binfile.add_binary(b'\x01\x02\x03\x04', address=1)

self.assertEqual(binfile[:], b'\x01\x02\x03\x04')
self.assertEqual(binfile[0], b'')
self.assertEqual(binfile[1], b'\x01')
self.assertEqual(binfile[2], b'\x02')
self.assertEqual(binfile[3], b'\x03')
self.assertEqual(binfile[4], b'\x04')
self.assertEqual(binfile[5], b'')
self.assertEqual(binfile[3:5], b'\x03\x04')
self.assertEqual(binfile[3:6], b'\x03\x04')

Expand All @@ -503,6 +507,10 @@ def test_set_get_item(self):
binfile[0] = b'\x00'
self.assertEqual(binfile[:], b'\x00\x01\x02\x03\x04\x05')

binfile[7] = b'\x07'
self.assertEqual(binfile[:], b'\x00\x01\x02\x03\x04\x05\xff\x07')
self.assertEqual(binfile[6], b'\xff')

def test_performance(self):
binfile = bincopy.BinFile()

Expand Down

0 comments on commit d559b29

Please sign in to comment.