示例#1
0
 def test_get_music_taste_exists(self):
     """
     If _music_taste is not None, music_taste() should return it.
     """
     u = UserData(None)
     test_data = ['test', 'hello']
     u._music_taste = test_data
     self.assertEqual(u.music_taste(), test_data)
示例#2
0
 def test_compile_music_taste(self):
     """
     _compile_music_taste() should request compile data about the
     user's music taste from Spotify and store it in the
     _music_taste variable.
     """
     u = UserData(self.session)
     data = u.music_taste()
     self.assertGreaterEqual(len(data), 50)
     for t in data:
         self.assertEqual(t['type'], 'track')