update supported audio files in settings.py

+ add win_replace_slash function to format win path strings
+ misc
This commit is contained in:
geoffrey45
2023-01-30 15:59:28 +03:00
parent 93a04ba041
commit 7e15680f26
15 changed files with 268 additions and 96 deletions
+14 -10
View File
@@ -1,33 +1,37 @@
from hypothesis import given
from hypothesis import strategies as st
import app.utils
from hypothesis import given, strategies as st
from app.utils import extract_featured_artists_from_title
from app.utils import parse_feat_from_title
def test_extract_featured_artists_from_title():
test_titles = [
"Own it (Featuring Ed Sheeran & Stormzy)",
"Own it (Featuring Ed Sheeran and Stormzy)",
"Autograph (On my line)(Feat. Lil Peep)(Deluxe)",
"Why so sad? (with Juice Wrld, Lil Peep)",
"Why so sad? (with Juice Wrld/Lil Peep)",
"Simmer (with Burna Boy)",
"Simmer (without Burna Boy)"
"Simmer (without Burna Boy)",
]
results = [
["Ed Sheeran", "Stormzy"],
['Lil Peep'],
["Juice Wrld", "Lil Peep"],
["Ed Sheeran", "Stormzy"],
["Lil Peep"],
["Juice Wrld", "Lil Peep"],
["Juice Wrld/Lil Peep"],
["Burna Boy"],
[]
[],
]
for title, expected in zip(test_titles, results):
assert extract_featured_artists_from_title(title) == expected
assert parse_feat_from_title(title) == expected
# === HYPOTHESIS GHOSTWRITER TESTS ===
@given(__dir=st.text(), full=st.booleans())
def test_fuzz_run_fast_scandir(__dir: str, full) -> None:
app.utils.run_fast_scandir(_dir=__dir, full=full)
# @given(__dir=st.text(), full=st.booleans())
# def test_fuzz_run_fast_scandir(__dir: str, full) -> None:
# app.utils.run_fast_scandir(_dir=__dir, full=full)