예제 #1
0
 def test_get_recently_played_exists(self):
     """
     If _recently_played is not None, recently_played() should
     return it.
     """
     u = UserData(None)
     test_data = ['test', 'hello']
     u._recently_played = test_data
     self.assertEqual(u.recently_played(), test_data)
예제 #2
0
 def test_compile_recently_played(self):
     """
     _compile_recently_played() should request data about the user's
     recently played tracks from Spotify and store it in the
     _saved_albums variable.
     """
     u = UserData(self.session)
     data = u.recently_played()
     self.assertEqual(len(data), 50)
     for t in data:
         self.assertEqual(t['type'], 'track')