Ejemplo n.º 1
0
    def test_param_body_mandatory(self, es):
        r = runner.PutPipeline()

        params = {"body": {}}
        with self.assertRaisesRegex(
                exceptions.DataError,
                "Parameter source for operation 'put-pipeline' did not provide the mandatory parameter 'id'. "
                "Please add it to your parameter source."):
            r(es, params)

        es.ingest.put_pipeline.assert_not_called()
Ejemplo n.º 2
0
    def test_create_pipeline(self, es):
        r = runner.PutPipeline()

        params = {
            "id": "rename",
            "body": {
                "description": "describe pipeline",
                "processors": [{
                    "set": {
                        "field": "foo",
                        "value": "bar"
                    }
                }]
            }
        }

        r(es, params)

        es.ingest.put_pipeline.assert_called_once_with(id="rename",
                                                       body=params["body"],
                                                       master_timeout=None,
                                                       timeout=None)