def test_get_album_year(): """Return MP4 track year.""" mp4 = Track.get_details(m4a_file_path) assert 2015 == mp4.get_album_year()
def test_get_track_genre(): """Return MP4 track genre.""" mp4 = Track.get_details(m4a_file_path) assert ['Electronic'] == mp4.get_track_genre()
def test_mp3_get_title(): mp3 = Track.get_details(mp3_file_path) assert 'LadyKilla Feat. Cocc Pistol Cree' == mp3.get_title()
def test_get_album_artists(): """Return MP4 track album artists.""" mp4 = Track.get_details(m4a_file_path) assert ['Amon Tobin'] == mp4.get_album_artists()
def test_get_track_genre(): mp3 = Track.get_details(mp3_file_path) assert ['Hip-Hop'] == mp3.get_track_genre()
def test_get_track_publisher(): mp3 = Track.get_details(mp3_file_path) assert ['HotNewHipHop.com'] == mp3.get_track_publisher()
def test_get_track_album(): mp3 = Track.get_details(mp3_file_path) assert 'Ketchup' == mp3.get_track_album()
def test_factory_returns_m4a_class(): m4a = Track.get_details('Amon Tobin/Dark Jovian/01 Dark Jovian.m4a') assert isinstance(m4a, M4a)
def test_mp3_get_album_artists(): mp3 = Track.get_details(mp3_file_path) assert 'DJ Mustard' == mp3.get_album_artists()
def test_mp3_get_album_year(): mp3 = Track.get_details(mp3_file_path_with_year) assert 1972 == mp3.get_album_year()
def test_factory_returns_mp3_class(): mp3_file_path = 'DJ Mustard/Ketchup - HotNewHipHop/08. DJ Mustard - LadyKilla Feat. Coc' +\ 'c Pistol Cree.mp3' mp3 = Track.get_details(mp3_file_path) assert isinstance(mp3, Mp3)
def test_error_if_filetype_not_supported(): with pytest.raises(Exception): Track.get_details('test.abc')
def test_factory_returns_mp4_class(): mp4 = Track.get_details('Amon Tobin/Dark Jovian/01 Dark Jovian.m4a') assert isinstance(mp4, Mp4)
def test_get_track_copyright(): """Return MP4 track copyright.""" mp4 = Track.get_details(m4a_file_path) assert mp4.get_track_copyright() is None
def test_get_track_number(): mp3 = Track.get_details(mp3_file_path) assert 8 == mp3.get_track_number()
def test_get_title(): """Return MP4 track title.""" mp4 = Track.get_details(m4a_file_path) assert ['Dark Jovian'] == mp4.get_title()
def test_factory_returns_flac_class(): flac = Track.get_details('test.flac') assert isinstance(flac, Flac)