def test_updateVideoIdStatusInCache_should_call_cache_setMulti_to_save_collection_in_cache(
            self):
        storage = YouTubeStorage()

        storage.updateVideoIdStatusInCache("some_id", [{"videoid": "test1"}])

        assert (sys.modules["__main__"].cache.setMulti.call_count == 1)
    def test_updateVideoIdStatusInCache_should_add_video_items_to_collection_saved_in_cache(
            self):
        storage = YouTubeStorage()

        storage.updateVideoIdStatusInCache("some_id", [{"videoid": "test1"}])

        sys.modules["__main__"].cache.setMulti.assert_called_with(
            "some_id", {"test1": repr({"videoid": "test1"})})
    def test_updateVideoIdStatusInCache_should_not_add_items_without_a_video_id_to_collection_saved_in_cache(
            self):
        storage = YouTubeStorage()

        storage.updateVideoIdStatusInCache("some_id", [{
            "other_stuff": "stuff"
        }])

        sys.modules["__main__"].cache.setMulti.assert_called_with(
            "some_id", {})
    def test_updateVideoIdStatusInCache_should_call_cache_setMulti_to_save_collection_in_cache(self):
        storage = YouTubeStorage()

        storage.updateVideoIdStatusInCache("some_id", [{"videoid": "test1"}])

        assert sys.modules["__main__"].cache.setMulti.call_count == 1
    def test_updateVideoIdStatusInCache_should_not_add_items_without_a_video_id_to_collection_saved_in_cache(self):
        storage = YouTubeStorage()

        storage.updateVideoIdStatusInCache("some_id", [{"other_stuff": "stuff"}])

        sys.modules["__main__"].cache.setMulti.assert_called_with("some_id", {})
    def test_updateVideoIdStatusInCache_should_add_video_items_to_collection_saved_in_cache(self):
        storage = YouTubeStorage()

        storage.updateVideoIdStatusInCache("some_id", [{"videoid": "test1"}])

        sys.modules["__main__"].cache.setMulti.assert_called_with("some_id", {"test1": repr({"videoid": "test1"})})