示例#1
0
def test_get_album_year():
    """Return MP4 track year."""
    mp4 = Track.get_details(m4a_file_path)
    assert 2015 == mp4.get_album_year()
示例#2
0
def test_get_track_genre():
    """Return MP4 track genre."""
    mp4 = Track.get_details(m4a_file_path)
    assert ['Electronic'] == mp4.get_track_genre()
示例#3
0
def test_mp3_get_title():
    mp3 = Track.get_details(mp3_file_path)
    assert 'LadyKilla Feat. Cocc Pistol Cree' == mp3.get_title()
示例#4
0
def test_get_album_artists():
    """Return MP4 track album artists."""
    mp4 = Track.get_details(m4a_file_path)
    assert ['Amon Tobin'] == mp4.get_album_artists()
示例#5
0
def test_get_track_genre():
    mp3 = Track.get_details(mp3_file_path)
    assert ['Hip-Hop'] == mp3.get_track_genre()
示例#6
0
def test_get_track_publisher():
    mp3 = Track.get_details(mp3_file_path)
    assert ['HotNewHipHop.com'] == mp3.get_track_publisher()
示例#7
0
def test_get_track_album():
    mp3 = Track.get_details(mp3_file_path)
    assert 'Ketchup' == mp3.get_track_album()
示例#8
0
def test_factory_returns_m4a_class():
    m4a = Track.get_details('Amon Tobin/Dark Jovian/01 Dark Jovian.m4a')
    assert isinstance(m4a, M4a)
示例#9
0
def test_mp3_get_album_artists():
    mp3 = Track.get_details(mp3_file_path)
    assert 'DJ Mustard' == mp3.get_album_artists()
示例#10
0
def test_mp3_get_album_year():
    mp3 = Track.get_details(mp3_file_path_with_year)
    assert 1972 == mp3.get_album_year()
示例#11
0
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)
示例#12
0
def test_error_if_filetype_not_supported():
    with pytest.raises(Exception):
        Track.get_details('test.abc')
示例#13
0
def test_factory_returns_mp4_class():
    mp4 = Track.get_details('Amon Tobin/Dark Jovian/01 Dark Jovian.m4a')
    assert isinstance(mp4, Mp4)
示例#14
0
def test_get_track_copyright():
    """Return MP4 track copyright."""
    mp4 = Track.get_details(m4a_file_path)
    assert mp4.get_track_copyright() is None
示例#15
0
def test_get_track_number():
    mp3 = Track.get_details(mp3_file_path)
    assert 8 == mp3.get_track_number()
示例#16
0
def test_get_title():
    """Return MP4 track title."""
    mp4 = Track.get_details(m4a_file_path)
    assert ['Dark Jovian'] == mp4.get_title()
示例#17
0
def test_factory_returns_flac_class():
    flac = Track.get_details('test.flac')
    assert isinstance(flac, Flac)