test_deprecation.py 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. from yandex_music import Deprecation
  2. class TestDeprecation:
  3. target_album_id = 11084011
  4. status = 'duplicate-of'
  5. done = True
  6. def test_expected_values(self, deprecation):
  7. assert deprecation.target_album_id == self.target_album_id
  8. assert deprecation.status == self.status
  9. assert deprecation.done == self.done
  10. def test_de_json_none(self, client):
  11. assert Deprecation.de_json({}, client) is None
  12. def test_de_json_required(self, client):
  13. json_dict = {'target_album_id': self.target_album_id, 'status': self.status, 'done': self.done}
  14. deprecation = Deprecation.de_json(json_dict, client)
  15. assert deprecation.target_album_id == self.target_album_id
  16. assert deprecation.status == self.status
  17. assert deprecation.done == self.done
  18. def test_de_json_all(self, client):
  19. json_dict = {'target_album_id': self.target_album_id, 'status': self.status, 'done': self.done}
  20. deprecation = Deprecation.de_json(json_dict, client)
  21. assert deprecation.target_album_id == self.target_album_id
  22. assert deprecation.status == self.status
  23. assert deprecation.done == self.done
  24. def test_equality(self):
  25. a = Deprecation(self.target_album_id, self.status, self.done)
  26. b = Deprecation(self.target_album_id, self.status, False)
  27. c = Deprecation(self.target_album_id, self.status, self.done)
  28. assert a != b
  29. assert hash(a) != hash(b)
  30. assert a is not b
  31. assert a == c