ingest_delete_pipeline_test.go 676 B

12345678910111213141516171819202122232425262728293031
  1. // Copyright 2012-present Oliver Eilhard. All rights reserved.
  2. // Use of this source code is governed by a MIT-license.
  3. // See http://olivere.mit-license.org/license.txt for details.
  4. package elastic
  5. import "testing"
  6. func TestIngestDeletePipelineURL(t *testing.T) {
  7. client := setupTestClientAndCreateIndex(t)
  8. tests := []struct {
  9. Id string
  10. Expected string
  11. }{
  12. {
  13. "my-pipeline-id",
  14. "/_ingest/pipeline/my-pipeline-id",
  15. },
  16. }
  17. for _, test := range tests {
  18. path, _, err := client.IngestDeletePipeline(test.Id).buildURL()
  19. if err != nil {
  20. t.Fatal(err)
  21. }
  22. if path != test.Expected {
  23. t.Errorf("expected %q; got: %q", test.Expected, path)
  24. }
  25. }
  26. }