Exemple #1
0
def testTagUrls():
    tag = Tag()
    url = "http://example.com/"
    url2 = "http://sample.com/"

    tag.commercial_url = url
    assert_equal(tag.commercial_url, url)
    tag.commercial_url = url2
    assert_equal(tag.commercial_url, url2)
    tag.commercial_url = None
    assert_is_none(tag.commercial_url)

    tag.copyright_url = url
    assert_equal(tag.copyright_url, url)
    tag.copyright_url = url2
    assert_equal(tag.copyright_url, url2)
    tag.copyright_url = None
    assert_is_none(tag.copyright_url)

    tag.audio_file_url = url
    assert_equal(tag.audio_file_url, url)
    tag.audio_file_url = url2
    assert_equal(tag.audio_file_url, url2)
    tag.audio_file_url = None
    assert_is_none(tag.audio_file_url)

    tag.audio_source_url = url
    assert_equal(tag.audio_source_url, url)
    tag.audio_source_url = url2
    assert_equal(tag.audio_source_url, url2)
    tag.audio_source_url = None
    assert_is_none(tag.audio_source_url)

    tag.artist_url = url
    assert_equal(tag.artist_url, url)
    tag.artist_url = url2
    assert_equal(tag.artist_url, url2)
    tag.artist_url = None
    assert_is_none(tag.artist_url)

    tag.internet_radio_url = url
    assert_equal(tag.internet_radio_url, url)
    tag.internet_radio_url = url2
    assert_equal(tag.internet_radio_url, url2)
    tag.internet_radio_url = None
    assert_is_none(tag.internet_radio_url)

    tag.payment_url = url
    assert_equal(tag.payment_url, url)
    tag.payment_url = url2
    assert_equal(tag.payment_url, url2)
    tag.payment_url = None
    assert_is_none(tag.payment_url)

    tag.publisher_url = url
    assert_equal(tag.publisher_url, url)
    tag.publisher_url = url2
    assert_equal(tag.publisher_url, url2)
    tag.publisher_url = None
    assert_is_none(tag.publisher_url)

    # Frame ID enforcement
    assert_raises(ValueError, tag._setUrlFrame, "WDDD", "url")
    assert_raises(ValueError, tag._getUrlFrame, "WDDD")
Exemple #2
0
def testTagUrls():
    tag = Tag()
    url = "http://example.com/"
    url2 = "http://sample.com/"

    tag.commercial_url = url
    assert (tag.commercial_url == url)
    tag.commercial_url = url2
    assert (tag.commercial_url == url2)
    tag.commercial_url = None
    assert (tag.commercial_url is None)

    tag.copyright_url = url
    assert (tag.copyright_url == url)
    tag.copyright_url = url2
    assert (tag.copyright_url == url2)
    tag.copyright_url = None
    assert (tag.copyright_url is None)

    tag.audio_file_url = url
    assert (tag.audio_file_url == url)
    tag.audio_file_url = url2
    assert (tag.audio_file_url == url2)
    tag.audio_file_url = None
    assert (tag.audio_file_url is None)

    tag.audio_source_url = url
    assert (tag.audio_source_url == url)
    tag.audio_source_url = url2
    assert (tag.audio_source_url == url2)
    tag.audio_source_url = None
    assert (tag.audio_source_url is None)

    tag.artist_url = url
    assert (tag.artist_url == url)
    tag.artist_url = url2
    assert (tag.artist_url == url2)
    tag.artist_url = None
    assert (tag.artist_url is None)

    tag.internet_radio_url = url
    assert (tag.internet_radio_url == url)
    tag.internet_radio_url = url2
    assert (tag.internet_radio_url == url2)
    tag.internet_radio_url = None
    assert (tag.internet_radio_url is None)

    tag.payment_url = url
    assert (tag.payment_url == url)
    tag.payment_url = url2
    assert (tag.payment_url == url2)
    tag.payment_url = None
    assert (tag.payment_url is None)

    tag.publisher_url = url
    assert (tag.publisher_url == url)
    tag.publisher_url = url2
    assert (tag.publisher_url == url2)
    tag.publisher_url = None
    assert (tag.publisher_url is None)

    # Frame ID enforcement
    with pytest.raises(ValueError):
        tag._setUrlFrame("WDDD", "url")
    with pytest.raises(ValueError):
        tag._getUrlFrame("WDDD")
Exemple #3
0
def testTagUrls():
    tag = Tag()
    url = "http://example.com/"
    url2 = "http://sample.com/"

    tag.commercial_url = url
    assert (tag.commercial_url == url)
    tag.commercial_url = url2
    assert (tag.commercial_url == url2)
    tag.commercial_url = None
    assert (tag.commercial_url is None)

    tag.copyright_url = url
    assert (tag.copyright_url == url)
    tag.copyright_url = url2
    assert (tag.copyright_url == url2)
    tag.copyright_url = None
    assert (tag.copyright_url is None)

    tag.audio_file_url = url
    assert (tag.audio_file_url == url)
    tag.audio_file_url = url2
    assert (tag.audio_file_url == url2)
    tag.audio_file_url = None
    assert (tag.audio_file_url is None)

    tag.audio_source_url = url
    assert (tag.audio_source_url == url)
    tag.audio_source_url = url2
    assert (tag.audio_source_url == url2)
    tag.audio_source_url = None
    assert (tag.audio_source_url is None)

    tag.artist_url = url
    assert (tag.artist_url == url)
    tag.artist_url = url2
    assert (tag.artist_url == url2)
    tag.artist_url = None
    assert (tag.artist_url is None)

    tag.internet_radio_url = url
    assert (tag.internet_radio_url == url)
    tag.internet_radio_url = url2
    assert (tag.internet_radio_url == url2)
    tag.internet_radio_url = None
    assert (tag.internet_radio_url is None)

    tag.payment_url = url
    assert (tag.payment_url == url)
    tag.payment_url = url2
    assert (tag.payment_url == url2)
    tag.payment_url = None
    assert (tag.payment_url is None)

    tag.publisher_url = url
    assert (tag.publisher_url == url)
    tag.publisher_url = url2
    assert (tag.publisher_url == url2)
    tag.publisher_url = None
    assert (tag.publisher_url is None)

    # Frame ID enforcement
    with pytest.raises(ValueError):
        tag._setUrlFrame("WDDD", "url")
    with pytest.raises(ValueError):
        tag._getUrlFrame("WDDD")