Scaruffi/scaruffi/tests.py

26 lines
714 B
Python
Raw Normal View History

2020-11-05 19:03:31 +01:00
import logging
2020-11-05 17:54:42 +01:00
import unittest
2020-11-05 19:03:31 +01:00
from scaruffi.api import ScaruffiApi
2020-11-05 17:54:42 +01:00
class TestScaruffi(unittest.TestCase):
2020-11-05 19:03:31 +01:00
def setUp(self):
self.api = ScaruffiApi()
def tearDown(self):
self.api = None
2020-11-05 17:54:42 +01:00
def test_get_musicians(self):
2020-11-05 19:03:31 +01:00
musicians = self.api.get_musicians()
2020-11-05 17:54:42 +01:00
self.assertEqual(len(musicians), 20)
def test_get_ratings(self):
2020-11-05 19:03:31 +01:00
self.assertIsNotNone(self.api.get_ratings(1960))
self.assertIsNotNone(self.api.get_ratings(1970))
self.assertIsNotNone(self.api.get_ratings(1980))
self.assertIsNotNone(self.api.get_ratings(1990))
self.assertIsNotNone(self.api.get_ratings(2000))
self.assertIsNotNone(self.api.get_ratings(2010))