# Path: gepify/providers/songs.py
# def get_song(song_name):
# def add_song_file(song_name, file, format):
# def has_song_format(song_name, format):
# def download_song(self, song_info, provider='youtube', format='mp3'):
# 
# Path: gepify/providers/playlists.py
# def get_playlist(service, playlist, format):
# def has_playlist(service, playlist, format):
# def checksum(tracks):
# def handle_error(playlist_cache_key):
# def create_zip_playlist(playlist, service, checksum, format='mp3'):
# def download_playlist(playlist, service, provider='youtube', format='mp3'):
# def clean_playlists():
# 
# Path: gepify/providers/youtube.py
# DEVELOPER_KEY = os.environ.get('YOUTUBE_DEVELOPER_KEY')
# YOUTUBE_API_SERVICE_NAME = 'youtube'
# YOUTUBE_API_VERSION = 'v3'
# def get_song_id(song_name):
# def download_song(id, format):
# 
# Path: gepify/providers/soundcloud.py
# SOUNDCLOUD_CLIENT_ID = os.environ.get('SOUNDCLOUD_CLIENT_ID')
# def get_song_id(song_name):
# def download_song(id, format):


from unittest import mock, TestCase
from gepify.providers import songs, playlists, youtube, soundcloud
from werkzeug.contrib.cache import SimpleCache
import json
import time
import os

    @mock.patch('youtube_dl.YoutubeDL.download')
    def test_download_song(self, download):
        youtube.download_song('song id', 'mp3')
        self.assertEqual(download.call_count, 1)
        download.assert_called_with(['http://www.youtube.com/watch?v=song id'])


class mocked_Response():
    def __init__(self, obj):
        self.obj = obj


class mocked_Client():
    def __init__(self, *args, **kwargs):
        pass

    def get(self, resource, q):
        if q == 'existing song':
            return [mocked_Response({
                'id': '1234',
                'permalink': 'song_permalink',
                'user': {
                    'permalink': 'user_permalink'
                }
            })]

        return []



# Path: gepify/providers/songs.py
# def get_song(song_name):
# def add_song_file(song_name, file, format):
# def has_song_format(song_name, format):
# def download_song(self, song_info, provider='youtube', format='mp3'):
# 
# Path: gepify/providers/playlists.py
# def get_playlist(service, playlist, format):
# def has_playlist(service, playlist, format):
# def checksum(tracks):
# def handle_error(playlist_cache_key):
# def create_zip_playlist(playlist, service, checksum, format='mp3'):
# def download_playlist(playlist, service, provider='youtube', format='mp3'):
# def clean_playlists():
# 
# Path: gepify/providers/youtube.py
# DEVELOPER_KEY = os.environ.get('YOUTUBE_DEVELOPER_KEY')
# YOUTUBE_API_SERVICE_NAME = 'youtube'
# YOUTUBE_API_VERSION = 'v3'
# def get_song_id(song_name):
# def download_song(id, format):
# 
# Path: gepify/providers/soundcloud.py
# SOUNDCLOUD_CLIENT_ID = os.environ.get('SOUNDCLOUD_CLIENT_ID')
# def get_song_id(song_name):
# def download_song(id, format):


# Path: tests/test_providers.py
from unittest import mock, TestCase
from gepify.providers import songs, playlists, youtube, soundcloud
from werkzeug.contrib.cache import SimpleCache
import json
import time
import os


    @mock.patch('youtube_dl.YoutubeDL.download')
    def test_download_song(self, download):
        youtube.download_song('song id', 'mp3')
        self.assertEqual(download.call_count, 1)
        download.assert_called_with(['http://www.youtube.com/watch?v=song id'])


class mocked_Response():
    def __init__(self, obj):
        self.obj = obj


class mocked_Client():
    def __init__(self, *args, **kwargs):
        pass

    def get(self, resource, q):
        if q == 'existing song':
            return [mocked_Response({
                'id': '1234',
                'permalink': 'song_permalink',
                'user': {
                    'permalink': 'user_permalink'
                }
            })]

        return []



class SoundcloudTestCase(TestCase):