def test_get_entity_404(self, mocker): client = mocker.Mock() client.get.return_value = http.Response(404, '') with pytest.raises(errors.SyncError, match="Entity with name 'entity' does not exist on remote."): event.get_entity(client, 'default', 'entity')
def test_get_entity(self, mocker): client = mocker.Mock() client.get.return_value = http.Response(200, '{"entity": "entity"}') resp = event.get_entity(client, 'default', 'entity') assert resp == {'entity': 'entity'}