def test_normalize_filename_pathlike(self): class PathLikeObject(os.PathLike): # pylint: disable=too-few-public-methods def __fspath__(self): return os.path.join(data_dir, "test.txt") path = PathLikeObject() filename = MediaInfo._normalize_filename(path) self.assertEqual(filename, os.path.join(data_dir, "test.txt"))
def test_normalize_filename_url(self): filename = MediaInfo._normalize_filename("https://localhost") self.assertEqual(filename, "https://localhost")
def test_normalize_filename_pathlib(self): path = pathlib.Path(data_dir, "test.txt") filename = MediaInfo._normalize_filename(path) self.assertEqual(filename, os.path.join(data_dir, "test.txt"))
def test_normalize_filename_str(self): path = os.path.join(data_dir, "test.txt") filename = MediaInfo._normalize_filename(path) self.assertEqual(filename, path)