def test_getResultSetStorageKey_should_return_correct_key_for_stored_searches(
            self):
        storage = YouTubeStorage()

        result = storage._getResultSetStorageKey({"feed": "search"})

        assert (result == "store_searches")
    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"})
    def test_getResultSetStorageKey_should_return_correct_key_for_generic_stores(
            self):
        storage = YouTubeStorage()

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

        assert (result == "store_pokeystore")
    def test_getResultSetStorageKey_should_handle_external_correctly(self):
        storage = YouTubeStorage()

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

        assert result.find("external") > 0
    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"})
    def test_getResultSetStorageKey_should_return_correct_key_for_music_artist_path(
            self):
        storage = YouTubeStorage()

        result = storage._getResultSetStorageKey({
            "scraper": "music_artist",
            "artist": "some_artist"
        })

        assert (result == "s_music_artist_some_artist")
    def test_getResultSetStorageKey_should_return_correct_key_for_disco_search_path(
            self):
        storage = YouTubeStorage()

        result = storage._getResultSetStorageKey({
            "scraper": "disco_search",
            "search": "some_search"
        })

        assert (result == "store_disco_searches")
    def test_getResultSetStorageKey_should_return_correct_key_for_for_show_scraper(
            self):
        storage = YouTubeStorage()

        result = storage._getResultSetStorageKey({
            "scraper": "show",
            "show": "some_show"
        })

        assert (result == "s_show_some_show_season_0")
    def test_getResultSetStorageKey_should_return_correct_key_for_subscription_path(
            self):
        storage = YouTubeStorage()

        result = storage._getResultSetStorageKey({
            "user_feed": "subscriptions",
            "channel": "some_channel"
        })

        assert (result == "result_subscriptions_some_channel")
    def test_getResultSetStorageKey_should_return_correct_key_for_playlist_path(
            self):
        storage = YouTubeStorage()

        result = storage._getResultSetStorageKey({
            "user_feed": "playlist",
            "playlist": "some_playlist"
        })

        assert (result == "result_playlist_some_playlist")
    def test_getResultSetStorageKey_should_return_correct_key_for_category_path(
            self):
        storage = YouTubeStorage()

        result = storage._getResultSetStorageKey({
            "scraper": "categories",
            "category": "some_category"
        })

        assert (result == "s_categories_category_some_category")
    def test_getResultSetStorageKey_should_handle_external_correctly(self):
        storage = YouTubeStorage()

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

        assert (result.find("external") > 0)
    def test_getResultSetStorageKey_should_return_correct_key_for_subscription_path(self):
        storage = YouTubeStorage()

        result = storage._getResultSetStorageKey({"user_feed": "subscriptions", "channel": "some_channel"})

        assert result == "result_subscriptions_some_channel"
    def test_getResultSetStorageKey_should_return_correct_key_for_playlist_path(self):
        storage = YouTubeStorage()

        result = storage._getResultSetStorageKey({"user_feed": "playlist", "playlist": "some_playlist"})

        assert result == "result_playlist_some_playlist"
    def test_getResultSetStorageKey_should_return_correct_key_for_category_path(self):
        storage = YouTubeStorage()

        result = storage._getResultSetStorageKey({"scraper": "categories", "category": "some_category"})

        assert result == "s_categories_category_some_category"
    def test_getResultSetStorageKey_should_return_correct_key_for_disco_search_path(self):
        storage = YouTubeStorage()

        result = storage._getResultSetStorageKey({"scraper": "disco_search", "search": "some_search"})

        assert result == "store_disco_searches"
    def test_getResultSetStorageKey_should_return_correct_key_for_for_show_scraper(self):
        storage = YouTubeStorage()

        result = storage._getResultSetStorageKey({"scraper": "show", "show": "some_show"})

        assert result == "s_show_some_show_season_0"
    def test_getResultSetStorageKey_should_return_correct_key_for_stored_searches(self):
        storage = YouTubeStorage()

        result = storage._getResultSetStorageKey({"feed": "search"})

        assert result == "store_searches"
    def test_getResultSetStorageKey_should_return_correct_key_for_generic_stores(self):
        storage = YouTubeStorage()

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

        assert result == "store_pokeystore"
    def test_getResultSetStorageKey_should_return_correct_key_for_music_artist_path(self):
        storage = YouTubeStorage()

        result = storage._getResultSetStorageKey({"scraper": "music_artist", "artist": "some_artist"})

        assert result == "s_music_artist_some_artist"