当前位置: 首页>>代码示例>>Python>>正文


Python YouTubeStorage.YouTubeStorage类代码示例

本文整理汇总了Python中YouTubeStorage.YouTubeStorage的典型用法代码示例。如果您正苦于以下问题:Python YouTubeStorage类的具体用法?Python YouTubeStorage怎么用?Python YouTubeStorage使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了YouTubeStorage类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_getStorageKey_should_call_getThumbnailStorageKey_if_type_is_thumbnail

    def test_getStorageKey_should_call_getThumbnailStorageKey_if_type_is_thumbnail(self):
        storage = YouTubeStorage()
        storage._getThumbnailStorageKey = Mock()

        result = storage.getStorageKey({"some_param": "param_value"}, "thumbnail")

        storage._getThumbnailStorageKey.assert_called_with({"some_param": "param_value"}, {})
开发者ID:aerickson,项目名称:youtube-xbmc-plugin,代码行数:7,代码来源:TestYouTubeStorage.py

示例2: test_getStorageKey_should_call_getResultSetStorageKey_if_type_is_not_set

    def test_getStorageKey_should_call_getResultSetStorageKey_if_type_is_not_set(self):
        storage = YouTubeStorage()
        storage._getResultSetStorageKey = Mock()

        result = storage.getStorageKey({"some_param": "param_value"})

        storage._getResultSetStorageKey.assert_called_with({"some_param": "param_value"})
开发者ID:aerickson,项目名称:youtube-xbmc-plugin,代码行数:7,代码来源:TestYouTubeStorage.py

示例3: test_saveStoredSearch_should_limit_search_collection_before_calling_store

    def test_saveStoredSearch_should_limit_search_collection_before_calling_store(self):
        sys.modules["__main__"].settings.getSetting.return_value = "0"
        storage = YouTubeStorage()
        storage.retrieveSettings = Mock()
        storage.retrieveSettings.return_value = [
            "some_search4",
            "some_search2",
            "some_search3",
            "",
            "",
            "",
            "",
            "",
            "",
            "",
            "",
        ]
        storage.storeSettings = Mock()

        storage.saveStoredSearch({"search": "some_search1", "old_search": "some_search2"})

        assert len(storage.storeSettings.call_args[0][1]) == 10
        storage.storeSettings.assert_called_with(
            {"search": "some_search1", "old_search": "some_search2"},
            ["some_search1", "some_search4", "some_search3", "", "", "", "", "", "", ""],
        )
开发者ID:aerickson,项目名称:youtube-xbmc-plugin,代码行数:26,代码来源:TestYouTubeStorage.py

示例4: test_getStorageKey_should_call_getViewModeStorageKey_if_type_is_viewmode

    def test_getStorageKey_should_call_getViewModeStorageKey_if_type_is_viewmode(self):
        storage = YouTubeStorage()
        storage._getViewModeStorageKey = Mock()

        result = storage.getStorageKey({"some_param": "param_value"}, "viewmode")

        storage._getViewModeStorageKey.assert_called_with({"some_param": "param_value"}, {})
开发者ID:aerickson,项目名称:youtube-xbmc-plugin,代码行数:7,代码来源:TestYouTubeStorage.py

示例5: test_store_should_call_getStorageKey_to_fetch_correct_storage_key

    def test_store_should_call_getStorageKey_to_fetch_correct_storage_key(self):
        storage = YouTubeStorage()
        storage.getStorageKey = Mock()

        result = storage.store({"store": "pokeystore"})

        storage.getStorageKey.assert_called_with({"store": "pokeystore"}, "", {})
开发者ID:aerickson,项目名称:youtube-xbmc-plugin,代码行数:7,代码来源:TestYouTubeStorage.py

示例6: test_getVideoIdStatusFromCache_should_set_overlay_information_on_requested

    def test_getVideoIdStatusFromCache_should_set_overlay_information_on_requested(self):
        storage = YouTubeStorage()
        sys.modules["__main__"].cache.getMulti.return_value = ["2"]

        result = storage.getVideoIdStatusFromCache("some_id", [{"videoid": "vid1", "Overlay": "1"}])

        assert result[0]["Overlay"] == "2"
开发者ID:aerickson,项目名称:youtube-xbmc-plugin,代码行数:7,代码来源:TestYouTubeStorage.py

示例7: test_retrieveResultSet_should_evaluate_content_from_sql_get

    def test_retrieveResultSet_should_evaluate_content_from_sql_get(self):
        storage = YouTubeStorage()
        sys.modules["__main__"].cache.get.return_value = "['some_value']"

        result = storage.retrieveResultSet("some_key")

        assert result == ["some_value"]
开发者ID:aerickson,项目名称:youtube-xbmc-plugin,代码行数:7,代码来源:TestYouTubeStorage.py

示例8: test_getVideoIdStatusFromCache_should_not_request_information_for_items_without_a_videoid

    def test_getVideoIdStatusFromCache_should_not_request_information_for_items_without_a_videoid(self):
        storage = YouTubeStorage()
        sys.modules["__main__"].cache.getMulti.return_value = ["2"]

        storage.getVideoIdStatusFromCache("some_id", [{"videoid": "vid1"}, {"other_id": "stuff"}])

        sys.modules["__main__"].cache.getMulti.assert_any_call("some_id", ["vid1"])
开发者ID:aerickson,项目名称:youtube-xbmc-plugin,代码行数:7,代码来源:TestYouTubeStorage.py

示例9: test_getVideoIdStatusFromCache_should_call_cache_GetMulti_to_request_information

    def test_getVideoIdStatusFromCache_should_call_cache_GetMulti_to_request_information(self):
        storage = YouTubeStorage()
        sys.modules["__main__"].cache.getMulti.return_value = ["2"]

        storage.getVideoIdStatusFromCache("some_id", [{"videoid": "vid1"}, {"other_id": "stuff"}])

        assert sys.modules["__main__"].cache.getMulti.call_count == 1
开发者ID:aerickson,项目名称:youtube-xbmc-plugin,代码行数:7,代码来源:TestYouTubeStorage.py

示例10: test_getThumbnailStorageKey_should_return_correct_key_for_search_item

    def test_getThumbnailStorageKey_should_return_correct_key_for_search_item(self):
        storage = YouTubeStorage()

        result = storage._getThumbnailStorageKey(
            {"some_param": "something"}, {"search": "some_search", "feed": "search"}
        )

        assert result == "search_some_search_thumb"
开发者ID:aerickson,项目名称:youtube-xbmc-plugin,代码行数:8,代码来源:TestYouTubeStorage.py

示例11: test_getReversePlaylistOrder_should_call_retrieve_to_fetch_reverse_value

    def test_getReversePlaylistOrder_should_call_retrieve_to_fetch_reverse_value(self):
        storage = YouTubeStorage()
        storage.retrieve = Mock()
        storage.retrieve.return_value = "true"

        result = storage.getReversePlaylistOrder({"playlist": "some_playlists"})

        assert result == True
开发者ID:aerickson,项目名称:youtube-xbmc-plugin,代码行数:8,代码来源:TestYouTubeStorage.py

示例12: test_changeSubscriptionView_should_call_getStorageKey

    def test_changeSubscriptionView_should_call_getStorageKey(self):
        storage = YouTubeStorage()
        storage.getStorageKey = Mock()
        storage.storeValue = Mock()

        storage.changeSubscriptionView({"view_mode": "my_view_mode"})

        storage.getStorageKey.assert_called_with({"user_feed": "my_view_mode", "view_mode": "my_view_mode"}, "viewmode")
开发者ID:aerickson,项目名称:youtube-xbmc-plugin,代码行数:8,代码来源:TestYouTubeStorage.py

示例13: YouTubeStorage

    def test_list_should_call_getStoredSearches_if_store_is_defined_in_params_but_not_artist_or_contact_option(self):
        storage = YouTubeStorage()
        storage.getStoredSearches = Mock()
        storage.getStoredSearches.return_value = ("", 200)

        storage.list({"store": "somestore"})

        storage.getStoredSearches.assert_called_with({"store": "somestore"})
开发者ID:aerickson,项目名称:youtube-xbmc-plugin,代码行数:8,代码来源:TestYouTubeStorage.py

示例14: test_getValueStorageKey_should_handle_external_marker

    def test_getValueStorageKey_should_handle_external_marker(self):
        storage = YouTubeStorage()

        result = storage._getValueStorageKey(
            {"user_feed": "playlist", "external": "true", "contact": "some_contact"}, {"playlist": "some_playlist"}
        )

        assert result == "reverse_playlist_some_playlist_external_some_contact"
开发者ID:aerickson,项目名称:youtube-xbmc-plugin,代码行数:8,代码来源:TestYouTubeStorage.py

示例15: test_getViewModeStorageKey_should_handle_external_marker

    def test_getViewModeStorageKey_should_handle_external_marker(self):
        storage = YouTubeStorage()

        result = storage._getViewModeStorageKey(
            {"channel": "some_channel", "external": "true", "contact": "some_contact"}
        )

        assert result[: result.find("_")] == "external"
开发者ID:aerickson,项目名称:youtube-xbmc-plugin,代码行数:8,代码来源:TestYouTubeStorage.py


注:本文中的YouTubeStorage.YouTubeStorage类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。