class TestNtfsPlugin(unittest.TestCase): def setUp(self): self.filename = "sample_images/ntfs_mbr.vhd" self.offset = SAMPLE_NTFS_PART_OFFSET self.p = NtfsPlugin() self.detector = FilesystemDetector() def test_detect(self): self.assertTrue(self.p.detect(self.filename, self.offset)) self.assertFalse(self.p.detect(self.filename, self.offset + 1)) def test_register(self): self.p.register() mbr_plugins = self.detector.mbr_plugins.get(0x07) gpt_plugins = self.detector.gpt_plugins.get(uuid.UUID("{EBD0A0A2-B9E5-4433-87C0-68B6B72699C7}")) self.assertEquals(len(mbr_plugins), 1) self.assertEquals(len(gpt_plugins), 1) def tearDown(self): # remove plugin registration self.detector._clear_plugins()
def setUp(self): self.filename = "sample_images/ntfs_mbr.vhd" self.offset = SAMPLE_NTFS_PART_OFFSET self.p = NtfsPlugin() self.detector = FilesystemDetector()