def test_get_check_404(self, mocker): client = mocker.Mock() client.get.return_value = http.Response(404, '') with pytest.raises(errors.SyncError, match="Check with name 'check' does not exist on remote."): event.get_check(client, 'default', 'check')
def test_get_check(self, mocker): client = mocker.Mock() client.get.return_value = http.Response(200, '{"check": "check"}') resp = event.get_check(client, 'default', 'check') assert resp == {'check': 'check'}