def register(self): """Registers this plugin with \ :class:`~rawdisk.filesystems.detector.FilesystemDetector` \ as gpt plugin, with type guid *{426f6f74-0000-11aa-aa11-00306543ecac}* """ detector = FilesystemDetector() detector.add_gpt_plugin(uuid.UUID("{426f6f74-0000-11aa-aa11-00306543ecac}"), self)
def test_detect_gpt_returns_none_when_plugin_returns_false(self): detector = FilesystemDetector() gpt_plugin_mock = Mock() gpt_plugin_mock.get_volume_object.return_value = "volume" gpt_plugin_mock.detect.return_value = False detector.add_gpt_plugin(self.guid_fs_id, gpt_plugin_mock) volume_object = detector.detect_gpt("filename", 0, self.guid_fs_id) self.assertIsNone(volume_object)
def test_detect_gpt_returns_valid_volume_object(self): detector = FilesystemDetector() gpt_plugin_mock = Mock() gpt_plugin_mock.get_volume_object.return_value = "volume" gpt_plugin_mock.detect.return_value = True detector.add_gpt_plugin(self.guid_fs_id, gpt_plugin_mock) volume_object = detector.detect_gpt("filename", 0, self.guid_fs_id) self.assertEquals(volume_object, "volume")
def register(self): """Registers this plugin with \ :class:`~rawdisk.filesystems.detector.FilesystemDetector` \ as gpt plugin, with type guid *{48465300-0000-11AA-AA11-00306543ECAC}* """ detector = FilesystemDetector() detector.add_gpt_plugin( uuid.UUID('{48465300-0000-11AA-AA11-00306543ECAC}'), self)
def register(self): """Registers this plugin with \ :class:`~rawdisk.filesystems.detector.FilesystemDetector` \ as gpt plugin, with type guid *{426f6f74-0000-11aa-aa11-00306543ecac}* """ detector = FilesystemDetector() detector.add_gpt_plugin( uuid.UUID('{426f6f74-0000-11aa-aa11-00306543ecac}'), self)
def register(self): """Registers this plugin with \ :class:`~rawdisk.filesystems.detector.FilesystemDetector` \ as gpt plugin, with type guid *{C12A7328-F81F-11D2-BA4B-00A0C93EC93B}* """ detector = FilesystemDetector() detector.add_gpt_plugin( uuid.UUID('{C12A7328-F81F-11D2-BA4B-00A0C93EC93B}'), self)
def test_singleton(self): detector = FilesystemDetector() self.assertEquals(len(detector.mbr_plugins), 0) detector.add_mbr_plugin(self.mbr_fs_id, object()) detector.add_gpt_plugin(self.guid_fs_id, object()) detector2 = FilesystemDetector() self.assertEquals(len(detector2.mbr_plugins), 1) self.assertEquals(len(detector2.gpt_plugins), 1)
def test_detect_gpt_calls_detect_on_gpt_plugin(self): offset = 0x10 filename = "filename" detector = FilesystemDetector() gpt_plugin_mock = Mock() gpt_plugin_mock.get_volume_object.return_value = "volume" detector.add_gpt_plugin(self.guid_fs_id, gpt_plugin_mock) detector.detect_gpt(filename, offset, self.guid_fs_id) gpt_plugin_mock.detect.assert_called_once_with(filename, offset)
def register(self): """Registers this plugin with \ :class:`~rawdisk.filesystems.detector.FilesystemDetector` \ as gpt plugin, with type guid *{C12A7328-F81F-11D2-BA4B-00A0C93EC93B}* """ detector = FilesystemDetector() detector.add_gpt_plugin( uuid.UUID('{C12A7328-F81F-11D2-BA4B-00A0C93EC93B}'), self )
def register(self): """Registers this plugin with :class:`FilesystemDetector \ <rawdisk.filesystems.detector.FilesystemDetector>` as gpt plugin, \ with type guid *{EBD0A0A2-B9E5-4433-87C0-68B6B72699C7}* and \ as mbr plugin with type id 0x07 """ detector = FilesystemDetector() detector.add_mbr_plugin(0x07, self) detector.add_gpt_plugin( uuid.UUID('{EBD0A0A2-B9E5-4433-87C0-68B6B72699C7}'), self)
def register(self): """Registers this plugin with \ :class:`~rawdisk.filesystems.detector.FilesystemDetector` \ as gpt plugin, with type guid *{48465300-0000-11AA-AA11-00306543ECAC}* """ detector = FilesystemDetector() detector.add_gpt_plugin( uuid.UUID('{48465300-0000-11AA-AA11-00306543ECAC}'), self )
def register(self): """Registers this plugin with :class:`FilesystemDetector \ <rawdisk.filesystems.detector.FilesystemDetector>` as gpt plugin, \ with type guid *{EBD0A0A2-B9E5-4433-87C0-68B6B72699C7}* and \ as mbr plugin with type id 0x07 """ detector = FilesystemDetector() detector.add_mbr_plugin(0x07, self) detector.add_gpt_plugin( uuid.UUID('{EBD0A0A2-B9E5-4433-87C0-68B6B72699C7}'), self )
def test_multiple_gpt_plugins_for_same_id(self): detector = FilesystemDetector() detector.add_gpt_plugin(self.guid_fs_id, object()) detector.add_gpt_plugin(self.guid_fs_id, object()) self.assertEquals(len(detector.gpt_plugins.get(self.guid_fs_id)), 2)