test_images.py 995 B

12345678910111213141516171819202122232425262728293031
  1. from yandex_music import Images
  2. class TestImages:
  3. _208x208 = 'http://avatars.mds.yandex.net/get-music-misc/28052/metagenre-pop-x208/orig'
  4. _300x300 = 'http://avatars.mds.yandex.net/get-music-misc/28052/metagenre-pop-x300/orig'
  5. def test_expected_values(self, images):
  6. assert images._208x208 == self._208x208
  7. assert images._300x300 == self._300x300
  8. def test_de_json_none(self, client):
  9. assert Images.de_json({}, client) is None
  10. def test_de_json_required(self, client):
  11. json_dict = {}
  12. Images.de_json(json_dict, client)
  13. def test_de_json_all(self, client):
  14. json_dict = {'_208x208': self._208x208, '_300x300': self._300x300}
  15. images = Images.de_json(json_dict, client)
  16. assert images._208x208 == self._208x208
  17. assert images._300x300 == self._300x300
  18. def test_equality(self):
  19. a = Images(self._208x208, self._300x300)
  20. b = Images(self._208x208, self._300x300)
  21. assert a == b