本文整理匯總了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'
示例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
示例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
示例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
示例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
示例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
示例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
示例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
示例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'
示例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
示例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
示例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
示例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