diff --git a/.gitignore b/.gitignore index 103e768..efdac2e 100644 --- a/.gitignore +++ b/.gitignore @@ -4,5 +4,6 @@ *.pyc *.secret .cache +.pytest_cache .vscode __pycache__ diff --git a/test_fediplay.py b/test_fediplay.py index ca47a26..12af02e 100644 --- a/test_fediplay.py +++ b/test_fediplay.py @@ -1,20 +1,21 @@ from os import environ -import fediplay +from fediplay.mastodon import extract_links +from fediplay.queue import build_play_command def test_extract_links(): toot = { 'content': "
#nowplaying #fediplay Grimes ft. Janelle Mon\u00e1e - Venus Fly https://www.youtube.com/watch?v=eTLTXDHrgtw
" } - urls = fediplay.extract_links(toot) + urls = extract_links(toot) assert urls == ['https://www.youtube.com/watch?v=eTLTXDHrgtw'] def test_build_play_command_default(): environ.pop('FEDIPLAY_PLAY_COMMAND') - play_command = fediplay.build_play_command('Awesome Music.mp3') + play_command = build_play_command('Awesome Music.mp3') assert play_command == 'ffplay -v 0 -nostats -hide_banner -autoexit -nodisp \'Awesome Music.mp3\'' def test_build_play_command_specified(): environ.update(FEDIPLAY_PLAY_COMMAND='afplay {filename}') - play_command = fediplay.build_play_command('Awesome Music.mp3') + play_command = build_play_command('Awesome Music.mp3') assert play_command == 'afplay \'Awesome Music.mp3\''