def test_getStorageKey_should_call_getValueStorageKey_if_type_is_value(self):
        storage = YouTubeStorage()
        storage._getValueStorageKey = Mock()

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

        storage._getValueStorageKey.assert_called_with({"some_param": "param_value"}, {})
    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"
    def test_getValueStorageKey_should_return_correct_key_for_reverse_playlist_item(
            self):
        storage = YouTubeStorage()

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

        assert (result == "reverse_playlist_some_playlist")
    def test_getStorageKey_should_call_getValueStorageKey_if_type_is_value(
            self):
        storage = YouTubeStorage()
        storage._getValueStorageKey = Mock()

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

        storage._getValueStorageKey.assert_called_with(
            {"some_param": "param_value"}, {})
    def test_getValueStorageKey_should_return_correct_key_for_reverse_playlist_action(
            self):
        storage = YouTubeStorage()

        result = storage._getValueStorageKey({
            "action": "reverse_order",
            "playlist": "some_playlist"
        })

        assert (result == "reverse_playlist_some_playlist")
    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")
    def test_getValueStorageKey_should_return_correct_key_for_reverse_playlist_item(self):
        storage = YouTubeStorage()

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

        assert result == "reverse_playlist_some_playlist"
    def test_getValueStorageKey_should_return_correct_key_for_reverse_playlist_action(self):
        storage = YouTubeStorage()

        result = storage._getValueStorageKey({"action": "reverse_order", "playlist": "some_playlist"})

        assert result == "reverse_playlist_some_playlist"