# Path: wham/apis/musicbrainz/models.py
# class MusicbrainzArtist(WhamModel):
# 
#     id = WhamCharField(max_length=255, primary_key=True)
#     name = WhamTextField()
#     country = WhamCharField(max_length=255, null=True)
# 
# 
#     class WhamMeta(MusicbrainzMeta):
#         endpoint = 'artist/'
# 
#     class Meta:
#         db_table = 'musicbrainz_artist'
# 
#     def __unicode__(self):
#         return self.name
# 
# Path: wham/tests.py
# def build_httmock_functions(mock_response_dir):
#     print 'building mock functions'
#     functions = []
#     for filename in listdir(mock_response_dir):
#         filepath = join(mock_response_dir,filename)
#         if isfile(filepath):
#             method = None
#             for _method in ('GET', 'POST', 'PUT', 'DELETE', 'PATCH'):
#                 if filename.startswith(_method):
#                     filename = filename[len(_method):]
#                     method = _method
# 
#             url = urllib2.unquote(filename)
# 
#             parts = urlparse(url)
#             params = {}
#             if parts.query:
#                 print parts.query
#                 params = dict(parse_qsl(parts.query))
#                 print params
#             with open(filepath) as f:
#                 content = f.read()
#                 functions.append(build_httmock_function(
#                     parts.scheme, parts.netloc, parts.path, content, params=params, method=method))
#     return functions


import json
import os
from os.path import dirname, join
from django.test import TestCase
from httmock import urlmatch, HTTMock
from requests import HTTPError
from wham.apis.musicbrainz.models import MusicbrainzArtist
from wham.tests import build_httmock_functions
            '582748ae-a993-4b14-a2be-199fe8f418e6',
            '65cc77e1-45cf-4c2a-958c-c7cca472970c',
            '98e4bf9e-9e33-4f07-9962-f7c1c2d773ba',
            '93eb7110-0bc9-4d3f-816b-4b52ef982ec8',
            '8ca01f46-53ac-4af2-8516-55a909c0905e',
            '2819834e-4e08-47b0-a2c4-b7672318e8f0',
            'd5cc67b8-1cc4-453b-96e8-44487acdebea',
            '9a6880e7-5795-4ed3-8c58-7fef968aaa61',
            '31e9c35b-2675-4632-8596-f9bd9286f6c8',
            '2dea8a55-623b-42bb-bda3-9fb784018b40',
            '2c1bc1cb-4ae8-427b-ba28-4a695e47388f',
            '0c502791-4ee9-4c5f-9696-0602b721ff3b',
            '5c9fefe7-7bbb-47f8-b54e-9b5361beed5c',
            '6821bf3f-5d5b-4b0f-8fa4-79d2ab2d9219',
            'c213f661-70a8-42aa-b858-62f5bd2d72e9',
            'e9fcd661-cf2f-4792-aa50-364e1a576ac3',
            '3a6d6481-142d-423f-91d4-55bbfff318ed',
            '0d8303d1-6653-43f1-a0ef-2fcd3835529f',
            '2af759f4-4c48-49eb-a512-ae463c40b99a',
            '1d45138d-c675-4016-87a7-7ad5cce5e1bc',
            '4e442c83-b547-4d6e-9270-cdd35e3c3195',
            '5b8a28ee-dc6b-48db-ae98-f4ef1f15ae6d',
            '18dc6bd7-9caa-4c2d-a2fc-e9546ebda6a4',
            '0e23b5e8-0f99-45f4-bb2d-a266d65f13f3',
            '381e8434-109a-439c-8acc-5d328359f2e0',
            '26fe7532-dc1e-45d1-bfcb-a7f83d4df98e',
        ]
        for id in ids:
            print '===================================================='
            try:

# Path: wham/apis/musicbrainz/models.py
# class MusicbrainzArtist(WhamModel):
# 
#     id = WhamCharField(max_length=255, primary_key=True)
#     name = WhamTextField()
#     country = WhamCharField(max_length=255, null=True)
# 
# 
#     class WhamMeta(MusicbrainzMeta):
#         endpoint = 'artist/'
# 
#     class Meta:
#         db_table = 'musicbrainz_artist'
# 
#     def __unicode__(self):
#         return self.name
# 
# Path: wham/tests.py
# def build_httmock_functions(mock_response_dir):
#     print 'building mock functions'
#     functions = []
#     for filename in listdir(mock_response_dir):
#         filepath = join(mock_response_dir,filename)
#         if isfile(filepath):
#             method = None
#             for _method in ('GET', 'POST', 'PUT', 'DELETE', 'PATCH'):
#                 if filename.startswith(_method):
#                     filename = filename[len(_method):]
#                     method = _method
# 
#             url = urllib2.unquote(filename)
# 
#             parts = urlparse(url)
#             params = {}
#             if parts.query:
#                 print parts.query
#                 params = dict(parse_qsl(parts.query))
#                 print params
#             with open(filepath) as f:
#                 content = f.read()
#                 functions.append(build_httmock_function(
#                     parts.scheme, parts.netloc, parts.path, content, params=params, method=method))
#     return functions


# Path: wham/apis/musicbrainz/tests.py
import json
import os
from os.path import dirname, join
from django.test import TestCase
from httmock import urlmatch, HTTMock
from requests import HTTPError
from wham.apis.musicbrainz.models import MusicbrainzArtist
from wham.tests import build_httmock_functions

            '582748ae-a993-4b14-a2be-199fe8f418e6',
            '65cc77e1-45cf-4c2a-958c-c7cca472970c',
            '98e4bf9e-9e33-4f07-9962-f7c1c2d773ba',
            '93eb7110-0bc9-4d3f-816b-4b52ef982ec8',
            '8ca01f46-53ac-4af2-8516-55a909c0905e',
            '2819834e-4e08-47b0-a2c4-b7672318e8f0',
            'd5cc67b8-1cc4-453b-96e8-44487acdebea',
            '9a6880e7-5795-4ed3-8c58-7fef968aaa61',
            '31e9c35b-2675-4632-8596-f9bd9286f6c8',
            '2dea8a55-623b-42bb-bda3-9fb784018b40',
            '2c1bc1cb-4ae8-427b-ba28-4a695e47388f',
            '0c502791-4ee9-4c5f-9696-0602b721ff3b',
            '5c9fefe7-7bbb-47f8-b54e-9b5361beed5c',
            '6821bf3f-5d5b-4b0f-8fa4-79d2ab2d9219',
            'c213f661-70a8-42aa-b858-62f5bd2d72e9',
            'e9fcd661-cf2f-4792-aa50-364e1a576ac3',
            '3a6d6481-142d-423f-91d4-55bbfff318ed',
            '0d8303d1-6653-43f1-a0ef-2fcd3835529f',
            '2af759f4-4c48-49eb-a512-ae463c40b99a',
            '1d45138d-c675-4016-87a7-7ad5cce5e1bc',
            '4e442c83-b547-4d6e-9270-cdd35e3c3195',
            '5b8a28ee-dc6b-48db-ae98-f4ef1f15ae6d',
            '18dc6bd7-9caa-4c2d-a2fc-e9546ebda6a4',
            '0e23b5e8-0f99-45f4-bb2d-a266d65f13f3',
            '381e8434-109a-439c-8acc-5d328359f2e0',
            '26fe7532-dc1e-45d1-bfcb-a7f83d4df98e',
        ]
        for id in ids:
            print '===================================================='
            try:

                artist = MusicbrainzArtist.objects.get(pk=id)