import os
import pytest

from ricecooker.utils.youtube_cache import YouTubeVideoCache 



""" *********** YouTube Cache FIXTURES *********** """

@pytest.fixture
def youtube_video_cache():
    cache_dir = os.path.join('tests', 'testcontent', 'youtubecache')
    assert os.path.isdir(cache_dir), 'Incorrect directory path setting'
    return YouTubeVideoCache(video_id='DFZb2qBIrEw', alias='test-video', cache_dir=cache_dir)



""" *********** YouTube Cache TESTS *********** """

def test_youtube_video_cache(youtube_video_cache):
    youtube_video_cache.get_video_info()
    video_cache_filepath = os.path.join('tests', 'testcontent', 'youtubecache', 'test-video.json')
    assert os.path.exists(video_cache_filepath)

@@ -82,10 +82,30 @@
 ache
- %0A
+, YouTubePlaylistCache
 %0A%0A%0A%22
@@ -438,16 +438,329 @@
 e_dir)%0A%0A
+@pytest.fixture%0Adef youtube_playlist_cache():%0A    cache_dir = os.path.join('tests', 'testcontent', 'youtubecache')%0A    assert os.path.isdir(cache_dir), 'Incorrect directory path setting'%0A    return YouTubePlaylistCache(playlist_id='PLOZioxrIwCv33zt5aFFjWqDoEMm55MVA9', alias='test-playlist', cache_dir=cache_dir)%0A
 %0A%0A%22%22%22 **
@@ -1045,8 +1045,273 @@
 lepath)%0A
+%0Adef test_youtube_playlist_cache(youtube_playlist_cache):%0A    youtube_playlist_cache.get_playlist_info()%0A    playlist_cache_filepath = os.path.join('tests', 'testcontent', 'youtubecache', 'test-playlist.json')%0A    assert os.path.exists(playlist_cache_filepath)%0A    

Add test for YouTube playlist