def test_get_artists(self): api = PhishNetAPI() artists_response = api.get_artists() assert artists_response['error_code'] == 0 assert artists_response['response']['count'] == len( artists_response['response']['data']) assert artists_response['response']['data']['1']['artistid'] == 1
def test_get_artists(self, requests_mock): api = PhishNetAPI('apikey123456789test1') with open('tests/data/all_artists.json') as f: all_artists_json = json.load(f) requests_mock.post(api.base_url + "artists/all", json=all_artists_json) artists_response = api.get_artists() assert artists_response['response']['count'] == 5 assert len(artists_response['response']['data']) == 5 assert artists_response['response']['data']['1']['artistid'] == 1