def test_discard_bytes(self): # read from 0 # no bytes to discard self.assertEqual(discard_bytes(512, 0), 0) # read from 10 # skip 502 of partial record self.assertEqual(discard_bytes(512, 10), 502) # read from middle of 4th record self.assertEqual(discard_bytes(512, 1792), 256) # read from end of 4th record self.assertEqual(discard_bytes(512, 1800), 248) # boundary case self.assertEqual(discard_bytes(512, 512), 0) self.assertEqual(discard_bytes(512, 1024), 0)