def _getBrowser(self, target_file: TargetFile) -> IBrowserHistory: if "History" in target_file.get_name(): if ".db" in target_file.get_extension(): return SafaryHistory(target_file.get_path()) else: return ChromeHistory(target_file.get_path()) else: if "places" in target_file.get_name(): return FirefoxHistory(target_file.get_path()) return None
def test_load_from_path(self): collie_path = "./tests/examples/collie.jpg" target_file = TargetFile(collie_path) self.assertEqual(target_file.get_extension(), ".jpg") self.assertTrue("JPEG" in target_file.get_type()) self.assertEqual(target_file.get_name(), "collie.jpg") self.assertEqual(len(target_file.get_binary()), 19863) self.assertEqual(target_file.get_path(), collie_path) self.assertEqual(target_file.get_directory(), "./tests/examples") self.assertEqual(target_file.get_info()["extension"], target_file.get_extension())