Andrea Grandi 2008-09-15 22:52:20 +00:00
parent 74f4803661
commit bf3423703e
1 changed files with 24 additions and 0 deletions

24
src/test_album.py Normal file
View File

@ -0,0 +1,24 @@
import unittest
import sys
sys.path.append('../')
import api
import album
apikey = "152a230561e72192b8b0f3e42362c6ff"
class testAlbum(unittest.TestCase):
""" A test class for the Album module. """
def setUp(self):
self.api_test = api.Api(apikey)
self.album_test = self.api_test.getAlbum("Oasis", "Supersonic")
def testAlbumName(self):
self.assertEqual(self.album_test.name, "Supersonic")
def testAlbumArtist(self):
self.assertEqual(self.album_test.artist.name, "Oasis")
if __name__ == '__main__':
unittest.main()