test_station_data.py 906 B

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