def test_get_personal_data_exists(self): """ If _personal_data is not None, personal_data() should return it. """ u = UserData(None) test_data = { 'test': 'hello' } u._personal_data = test_data self.assertEqual(u.personal_data(), test_data)
def test_compile_personal_data(self): """ _compile_personal_data() should request data about the user's personal data from Spotify and store it in the _personal_data variable. """ u = UserData(self.session) data = u.personal_data() self.assertIsNotNone(data.get('followers')) self.assertIsNotNone(data.get('display_name'))