test_personal_playlists_data.py 1.2 KB

1234567891011121314151617181920212223242526272829303132333435
  1. from yandex_music import PersonalPlaylistsData
  2. class TestPersonalPlaylistsData:
  3. is_wizard_passed = True
  4. def test_expected_values(self, personal_playlists_data):
  5. assert personal_playlists_data.is_wizard_passed == self.is_wizard_passed
  6. def test_de_json_none(self, client):
  7. assert PersonalPlaylistsData.de_json({}, client) is None
  8. def test_de_json_required(self, client):
  9. json_dict = {'is_wizard_passed': self.is_wizard_passed}
  10. personal_playlists_data = PersonalPlaylistsData.de_json(json_dict, client)
  11. assert personal_playlists_data.is_wizard_passed == self.is_wizard_passed
  12. def test_de_json_all(self, client):
  13. json_dict = {'is_wizard_passed': self.is_wizard_passed}
  14. personal_playlists_data = PersonalPlaylistsData.de_json(json_dict, client)
  15. assert personal_playlists_data.is_wizard_passed == self.is_wizard_passed
  16. def test_equality(self):
  17. a = PersonalPlaylistsData(self.is_wizard_passed)
  18. b = PersonalPlaylistsData(False)
  19. c = PersonalPlaylistsData(self.is_wizard_passed)
  20. assert a != b
  21. assert hash(a) != hash(b)
  22. assert a is not b
  23. assert a == c