test_permission_alerts.py 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. import pytest
  2. from yandex_music import PermissionAlerts
  3. @pytest.fixture(scope='class')
  4. def permission_alerts():
  5. return PermissionAlerts(TestPermissionAlerts.alerts)
  6. class TestPermissionAlerts:
  7. alerts = []
  8. def test_expected_values(self, permission_alerts):
  9. assert permission_alerts.alerts == self.alerts
  10. def test_de_json_none(self, client):
  11. assert PermissionAlerts.de_json({}, client) is None
  12. def test_de_json_required(self, client):
  13. json_dict = {'alerts': self.alerts}
  14. permission_alerts = PermissionAlerts.de_json(json_dict, client)
  15. assert permission_alerts.alerts == self.alerts
  16. def test_de_json_all(self, client):
  17. json_dict = {'alerts': self.alerts}
  18. permission_alerts = PermissionAlerts.de_json(json_dict, client)
  19. assert permission_alerts.alerts == self.alerts
  20. def test_equality(self, permissions):
  21. a = PermissionAlerts([])
  22. assert a != permissions
  23. assert hash(a) != hash(permissions)
  24. assert a is not permissions