當前位置: 首頁>>代碼示例>>Python>>正文


Python PandoraUri._from_uri方法代碼示例

本文整理匯總了Python中mopidy_pandora.uri.PandoraUri._from_uri方法的典型用法代碼示例。如果您正苦於以下問題:Python PandoraUri._from_uri方法的具體用法?Python PandoraUri._from_uri怎麽用?Python PandoraUri._from_uri使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在mopidy_pandora.uri.PandoraUri的用法示例。


在下文中一共展示了PandoraUri._from_uri方法的13個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: test_search_uri_parse

# 需要導入模塊: from mopidy_pandora.uri import PandoraUri [as 別名]
# 或者: from mopidy_pandora.uri.PandoraUri import _from_uri [as 別名]
def test_search_uri_parse():

    obj = PandoraUri._from_uri('pandora:search:S1234567')
    assert type(obj) is SearchUri

    assert obj.uri_type == SearchUri.uri_type
    assert obj.token == 'S1234567'

    obj = PandoraUri._from_uri('pandora:search:R123456')
    assert type(obj) is SearchUri

    assert obj.uri_type == SearchUri.uri_type
    assert obj.token == 'R123456'

    obj = PandoraUri._from_uri('pandora:search:C12345')
    assert type(obj) is SearchUri

    assert obj.uri_type == SearchUri.uri_type
    assert obj.token == 'C12345'

    obj = PandoraUri._from_uri('pandora:search:G123')
    assert type(obj) is SearchUri

    assert obj.uri_type == SearchUri.uri_type
    assert obj.token == 'G123'
開發者ID:rectalogic,項目名稱:mopidy-pandora,代碼行數:27,代碼來源:test_uri.py

示例2: test_track_uri_is_ad

# 需要導入模塊: from mopidy_pandora.uri import PandoraUri [as 別名]
# 或者: from mopidy_pandora.uri.PandoraUri import _from_uri [as 別名]
def test_track_uri_is_ad(playlist_item_mock, ad_item_mock):
    track_uri = TrackUri._from_track(ad_item_mock)
    obj = PandoraUri._from_uri(track_uri.uri)

    assert type(obj) is AdItemUri

    track_uri = TrackUri._from_track(playlist_item_mock)
    obj = PandoraUri._from_uri(track_uri.uri)

    assert type(obj) is not AdItemUri
開發者ID:rectalogic,項目名稱:mopidy-pandora,代碼行數:12,代碼來源:test_uri.py

示例3: test_pandora_parse_mock_uri

# 需要導入模塊: from mopidy_pandora.uri import PandoraUri [as 別名]
# 或者: from mopidy_pandora.uri.PandoraUri import _from_uri [as 別名]
def test_pandora_parse_mock_uri():
    uri = 'pandora:station:id_mock:token_mock'
    obj = PandoraUri._from_uri(uri)

    assert isinstance(obj, PandoraUri)
    assert type(obj) is StationUri
    assert obj.uri == uri
開發者ID:rectalogic,項目名稱:mopidy-pandora,代碼行數:9,代碼來源:test_uri.py

示例4: test_genre_uri_parse

# 需要導入模塊: from mopidy_pandora.uri import PandoraUri [as 別名]
# 或者: from mopidy_pandora.uri.PandoraUri import _from_uri [as 別名]
def test_genre_uri_parse():
    mock_uri = 'pandora:genre:category_mock'
    obj = PandoraUri._from_uri(mock_uri)

    assert type(obj) is GenreUri

    assert obj.uri_type == 'genre'
    assert obj.category_name == 'category_mock'

    assert obj.uri == mock_uri
開發者ID:rectalogic,項目名稱:mopidy-pandora,代碼行數:12,代碼來源:test_uri.py

示例5: test_genre_station_uri_parse

# 需要導入模塊: from mopidy_pandora.uri import PandoraUri [as 別名]
# 或者: from mopidy_pandora.uri.PandoraUri import _from_uri [as 別名]
def test_genre_station_uri_parse():
    mock_uri = 'pandora:genre_station:G100:G100'
    obj = PandoraUri._from_uri(mock_uri)

    assert type(obj) is GenreStationUri

    assert obj.uri_type == 'genre_station'
    assert obj.station_id == 'G100'
    assert obj.token == 'G100'

    assert obj.uri == mock_uri
開發者ID:rectalogic,項目名稱:mopidy-pandora,代碼行數:13,代碼來源:test_uri.py

示例6: test_ad_uri_parse

# 需要導入模塊: from mopidy_pandora.uri import PandoraUri [as 別名]
# 或者: from mopidy_pandora.uri.PandoraUri import _from_uri [as 別名]
def test_ad_uri_parse():
    mock_uri = 'pandora:ad:id_mock:ad_token_mock'
    obj = PandoraUri._from_uri(mock_uri)

    assert type(obj) is AdItemUri

    assert obj.uri_type == 'ad'
    assert obj.station_id == 'id_mock'
    assert obj.ad_token == 'ad_token_mock'

    assert obj.uri == mock_uri
開發者ID:rectalogic,項目名稱:mopidy-pandora,代碼行數:13,代碼來源:test_uri.py

示例7: test_track_uri_parse

# 需要導入模塊: from mopidy_pandora.uri import PandoraUri [as 別名]
# 或者: from mopidy_pandora.uri.PandoraUri import _from_uri [as 別名]
def test_track_uri_parse(playlist_item_mock):
    track_uri = TrackUri._from_track(playlist_item_mock)

    obj = PandoraUri._from_uri(track_uri.uri)

    assert type(obj) is PlaylistItemUri

    assert obj.uri_type == conftest.MOCK_TRACK_TYPE
    assert obj.station_id == conftest.MOCK_STATION_ID
    assert obj.token == conftest.MOCK_TRACK_TOKEN

    assert obj.uri == track_uri.uri
開發者ID:rectalogic,項目名稱:mopidy-pandora,代碼行數:14,代碼來源:test_uri.py

示例8: test_station_uri_parse

# 需要導入模塊: from mopidy_pandora.uri import PandoraUri [as 別名]
# 或者: from mopidy_pandora.uri.PandoraUri import _from_uri [as 別名]
def test_station_uri_parse(get_station_mock_return_value):
    station_uri = StationUri._from_station(get_station_mock_return_value)

    obj = PandoraUri._from_uri(station_uri.uri)

    assert type(obj) is StationUri

    assert obj.uri_type == conftest.MOCK_STATION_TYPE
    assert obj.station_id == conftest.MOCK_STATION_ID
    assert obj.token == conftest.MOCK_STATION_TOKEN

    assert obj.uri == station_uri.uri
開發者ID:rectalogic,項目名稱:mopidy-pandora,代碼行數:14,代碼來源:test_uri.py

示例9: test_pandora_repr_converts_to_string

# 需要導入模塊: from mopidy_pandora.uri import PandoraUri [as 別名]
# 或者: from mopidy_pandora.uri.PandoraUri import _from_uri [as 別名]
def test_pandora_repr_converts_to_string():
    uri = 'pandora:station:id_mock:'
    obj = PandoraUri._from_uri(uri)

    obj.token = 0
    assert obj.uri == uri + '0'
開發者ID:rectalogic,項目名稱:mopidy-pandora,代碼行數:8,代碼來源:test_uri.py

示例10: test_pandora_parse_unicode_mock_uri

# 需要導入模塊: from mopidy_pandora.uri import PandoraUri [as 別名]
# 或者: from mopidy_pandora.uri.PandoraUri import _from_uri [as 別名]
def test_pandora_parse_unicode_mock_uri():
    uri = PlaylistItemUri(conftest.MOCK_STATION_ID, 'Ω≈ç√∫:˜µ≤≥÷')
    obj = PandoraUri._from_uri(uri.uri)

    assert isinstance(obj, PandoraUri)
    assert obj.uri == uri.uri
開發者ID:rectalogic,項目名稱:mopidy-pandora,代碼行數:8,代碼來源:test_uri.py

示例11: test_search_uri_is_genre_search

# 需要導入模塊: from mopidy_pandora.uri import PandoraUri [as 別名]
# 或者: from mopidy_pandora.uri.PandoraUri import _from_uri [as 別名]
def test_search_uri_is_genre_search():
    obj = PandoraUri._from_uri('pandora:search:S1234567')
    assert not obj.is_genre_search

    obj.token = 'G123'
    assert obj.is_genre_search
開發者ID:rectalogic,項目名稱:mopidy-pandora,代碼行數:8,代碼來源:test_uri.py

示例12: test_search_uri_is_composer_search

# 需要導入模塊: from mopidy_pandora.uri import PandoraUri [as 別名]
# 或者: from mopidy_pandora.uri.PandoraUri import _from_uri [as 別名]
def test_search_uri_is_composer_search():
    obj = PandoraUri._from_uri('pandora:search:S1234567')
    assert not obj.is_composer_search

    obj.token = 'C12345'
    assert obj.is_composer_search
開發者ID:rectalogic,項目名稱:mopidy-pandora,代碼行數:8,代碼來源:test_uri.py

示例13: test_search_uri_is_artist_search

# 需要導入模塊: from mopidy_pandora.uri import PandoraUri [as 別名]
# 或者: from mopidy_pandora.uri.PandoraUri import _from_uri [as 別名]
def test_search_uri_is_artist_search():
    obj = PandoraUri._from_uri('pandora:search:S1234567')
    assert not obj.is_artist_search

    obj.token = 'R123456'
    assert obj.is_artist_search
開發者ID:rectalogic,項目名稱:mopidy-pandora,代碼行數:8,代碼來源:test_uri.py


注:本文中的mopidy_pandora.uri.PandoraUri._from_uri方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。