test_playlist_absence.py 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. from yandex_music import PlaylistAbsence
  2. class TestPlaylistAbsence:
  3. kind = 1003
  4. reason = 'playlist-is-deleted'
  5. def test_expected_values(self, playlist_absence):
  6. assert playlist_absence.kind == self.kind
  7. assert playlist_absence.reason == self.reason
  8. def test_de_json_none(self, client):
  9. assert PlaylistAbsence.de_json({}, client) is None
  10. def test_de_json_required(self, client):
  11. json_dict = {'kind': self.kind, 'reason': self.reason}
  12. playlist_absence = PlaylistAbsence.de_json(json_dict, client)
  13. assert playlist_absence.kind == self.kind
  14. assert playlist_absence.reason == self.reason
  15. def test_de_json_all(self, client):
  16. json_dict = {'kind': self.kind, 'reason': self.reason}
  17. playlist_absence = PlaylistAbsence.de_json(json_dict, client)
  18. assert playlist_absence.kind == self.kind
  19. assert playlist_absence.reason == self.reason
  20. def test_equality(self):
  21. a = PlaylistAbsence(self.kind, self.reason)
  22. b = PlaylistAbsence(10, self.reason)
  23. c = PlaylistAbsence(self.kind, self.reason)
  24. assert a != b
  25. assert hash(a) != hash(b)
  26. assert a is not b
  27. assert a == c