Fixed album search test

This commit is contained in:
Paul Lamere 2014-06-19 14:41:52 -04:00
parent 9b5b65073c
commit ceaa030468
6 changed files with 7 additions and 7 deletions

View File

@ -1,2 +1,3 @@
v<version>, <date> -- Initial release. v1.40, June 12, 2014 -- Initial public release.
v1.42, June 19, 2014 -- Removed dependency on simplejson

View File

@ -1,4 +1,3 @@
import sys import sys
import spotipy import spotipy

View File

@ -3,11 +3,11 @@ from setuptools import setup
setup( setup(
name='SpotipyWebApi', name='SpotipyWebApi',
version='1.41', version='1.42',
description='simple client for the Spotify Web API', description='simple client for the Spotify Web API',
author="@plamere", author="@plamere",
author_email="paul@echonest.com", author_email="paul@echonest.com",
url='http://github.com/plamere/spotipy', url='http://github.com/plamere/spotipy',
install_requires=['requests>=1.0', 'simplejson>=3.5.2'], install_requires=['requests>=1.0'],
license='LICENSE.txt', license='LICENSE.txt',
py_modules=['spotipy', 'spotipy.oauth2'],) py_modules=['spotipy', 'spotipy.oauth2'],)

View File

@ -4,7 +4,7 @@ from __future__ import print_function
import base64 import base64
import requests import requests
import simplejson as json import json
__all__ = ['oauth2'] __all__ = ['oauth2']

View File

@ -2,7 +2,7 @@ import base64
import urllib import urllib
import requests import requests
import os import os
import simplejson as json import json
import time import time
class SpotifyOauthError(Exception): class SpotifyOauthError(Exception):

View File

@ -86,7 +86,7 @@ class TestSpotipy(unittest.TestCase):
results = self.spotify.search(q='weezer pinkerton', type='album') results = self.spotify.search(q='weezer pinkerton', type='album')
self.assertTrue('albums' in results) self.assertTrue('albums' in results)
self.assertTrue(len(results['albums']['items']) > 0) self.assertTrue(len(results['albums']['items']) > 0)
self.assertTrue(results['albums']['items'][0]['name'] == 'Pinkerton') self.assertTrue(results['albums']['items'][0]['name'].find('Pinkerton') >= 0)
def test_track_search(self): def test_track_search(self):
results = self.spotify.search(q='el scorcho weezer', type='track') results = self.spotify.search(q='el scorcho weezer', type='track')