Add tests to main function

Signed-off-by: nathom <nathanthomas707@gmail.com>
This commit is contained in:
nathom 2021-06-15 15:53:55 -07:00
parent 11443af6aa
commit 81d0686c26
2 changed files with 62 additions and 56 deletions

View file

@ -652,6 +652,7 @@ class MusicDL(list):
def essence(s):
s = re.sub(r"&#\d+;", "", s) # remove HTML entities
# TODO: change to finditer
return "".join(words.findall(s))
def get_titles(s):

View file

@ -53,9 +53,10 @@ def check_album_dl_success(folder, correct):
click.secho(f"Check for {folder} succeeded!", fg="green")
reset_config()
download_albums()
check_album_dl_success(
def main():
reset_config()
download_albums()
check_album_dl_success(
"/Users/nathan/StreamripDownloads/Morcheeba - Blackest Blue (2021) [FLAC] [24B-44.1kHz]",
{
"04. Morcheeba - Say It's Over.flac",
@ -70,9 +71,9 @@ check_album_dl_success(
"05. Morcheeba - Sulphur Soul.flac",
"06. Morcheeba - Oh Oh Yeah.flac",
},
)
)
check_album_dl_success(
check_album_dl_success(
"/Users/nathan/StreamripDownloads/KHALED KHALED",
{
"05. DJ Khaled - I DID IT (feat. Post Malone, Megan Thee Stallion, Lil Baby & DaBaby).mp3",
@ -90,9 +91,9 @@ check_album_dl_success(
"06. DJ Khaled - LET IT GO (feat. Justin Bieber & 21 Savage).mp3",
"11. DJ Khaled - JUST BE (feat. Justin Timberlake).mp3",
},
)
)
check_album_dl_success(
check_album_dl_success(
"/Users/nathan/StreamripDownloads/Paul Weller - Fat Pop (2021) [FLAC] [24B-44.1kHz]",
{
"01. Paul Weller - Cosmic Fringes.flac",
@ -109,5 +110,9 @@ check_album_dl_success(
"10. Paul Weller - Moving Canvas.flac",
"07. Paul Weller - Testify.flac",
},
)
restore_config()
)
restore_config()
if __name__ == "__main__":
main()