コード例 #1
0
 def testDecodeWithWrongOffset(self):
     with self.assertRaises(struct.error):
         fmap.fmap_decode(self.example_blob, 42)
コード例 #2
0
 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)
コード例 #3
0
 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')
コード例 #4
0
 def testDecodeWithOffset(self):
     decoded = fmap.fmap_decode(self.example_blob, 512)
     self.assertEqual(_EXAMPLE_BIN_FMAP, decoded)