def test_get_top_genres_shortterm_exists(self): """ If _top_genres['short_term'] is not None, top_genres('short_term') should return it. """ u = UserData(None) test_data = [['hello', 'there'], ['goodbye', 'now']] u._top_genres['short_term'] = test_data self.assertEqual(u.top_genres('short_term'), test_data)
def test_compile_top_genres_shortterm(self): """ _compile_top_genres('short_term') should request data about the user's top genres from Spotify and store it in the _top_genres['short_term'] variable. """ u = UserData(self.session) data = u.top_genres('short_term') self.assertGreaterEqual(len(data), 10) for gl in data: self.assertIsInstance(gl, list) for g in gl: self.assertIsInstance(g, str)