示例#1
0
    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"))
示例#2
0
 def test_normalize_filename_url(self):
     filename = MediaInfo._normalize_filename("https://localhost")
     self.assertEqual(filename, "https://localhost")
示例#3
0
 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"))
示例#4
0
 def test_normalize_filename_str(self):
     path = os.path.join(data_dir, "test.txt")
     filename = MediaInfo._normalize_filename(path)
     self.assertEqual(filename, path)