Cleaning up code.

This commit is contained in:
Roland 2019-10-14 17:20:59 -06:00
parent dc4ce0bda1
commit f6bdf3a3ec
No known key found for this signature in database
GPG key ID: 9D6DBD3ACF11AB93
2 changed files with 4 additions and 4 deletions

View file

@ -1,7 +1,6 @@
#! /usr/bin/env python3
import glob
import hashlib
import json
import logging
import pathlib
import re
@ -166,7 +165,8 @@ def replace_extension(path: pathlib.Path, new_ext) -> pathlib.Path:
return path
def find_meta_files(path: pathlib.Path, relative_to=None) -> Tuple[pathlib.Path, pathlib.Path, pathlib.Path, pathlib.Path]:
def find_meta_files(path: pathlib.Path, relative_to=None) -> Tuple[
pathlib.Path, pathlib.Path, pathlib.Path, pathlib.Path]:
"""Find all files that share a file's full path, except their extensions. It is assumed that file with the
same name, but different extension is related to that file.

View file

@ -177,8 +177,8 @@ class TestAPI(unittest.TestCase):
# Final channel video list we built
expected = {
('subdir/' + vid1.name, 'subdir/' + poster1.name, None), # in a subdirectory, no description
(vid2.name, poster2.name, None), # no description
(vid3.name, None, description3.name), # no poster
(vid2.name, poster2.name, None), # no description
(vid3.name, None, description3.name), # no poster
}
self.assertEqual(
{(i['video_path'], i['poster_path'], i['description_path']) for i in channel['videos']},