def testDecodeWithWrongOffset(self): with self.assertRaises(struct.error): fmap.fmap_decode(self.example_blob, 42)
def testDecodeWithName(self): decoded = fmap.fmap_decode(self.example_blob, fmap_name='example') self.assertEqual(_EXAMPLE_BIN_FMAP, decoded) decoded = fmap.fmap_decode(self.example_blob, 512, 'example') self.assertEqual(_EXAMPLE_BIN_FMAP, decoded)
def testDecodeWithWrongName(self): with self.assertRaises(struct.error): fmap.fmap_decode(self.example_blob, fmap_name='banana') with self.assertRaises(struct.error): fmap.fmap_decode(self.example_blob, 512, 'banana')
def testDecodeWithOffset(self): decoded = fmap.fmap_decode(self.example_blob, 512) self.assertEqual(_EXAMPLE_BIN_FMAP, decoded)