diff --git a/api/pipelines/pipelines_test.go b/api/pipelines/pipelines_test.go index 5dcfd81b3..4803722da 100644 --- a/api/pipelines/pipelines_test.go +++ b/api/pipelines/pipelines_test.go @@ -76,7 +76,7 @@ func TestPipelines_Trigger(t *testing.T) { assert.Check(t, cmp.Equal(fix.method, "POST")) assert.Check(t, cmp.DeepEqual(fix.Header(), http.Header{ "Accept-Encoding": {"gzip"}, - "Accept-Type": {"application/json"}, + "Accept": {"application/json"}, "Circle-Token": {"fake-token"}, "Content-Length": {"24"}, "Content-Type": {"application/json"}, @@ -174,7 +174,7 @@ func TestPipelines_Get(t *testing.T) { assert.Check(t, cmp.Equal(fix.method, "GET")) assert.Check(t, cmp.DeepEqual(fix.Header(), http.Header{ "Accept-Encoding": {"gzip"}, - "Accept-Type": {"application/json"}, + "Accept": {"application/json"}, "Circle-Token": {"fake-token"}, "User-Agent": {version.UserAgent()}, })) @@ -234,5 +234,6 @@ func (f *fixture) Run(statusCode int, respBody string) (p *Pipelines, cleanup fu return New(rest.NewFromConfig(server.URL, &settings.Config{ RestEndpoint: "api/v2", Token: "fake-token", + HTTPClient: server.Client(), })), server.Close } diff --git a/cmd/.circleci/cli.yml b/cmd/.circleci/cli.yml new file mode 100644 index 000000000..e69de29bb diff --git a/cmd/.circleci/telemetry.yml b/cmd/.circleci/telemetry.yml new file mode 100644 index 000000000..ceb1c9f7c --- /dev/null +++ b/cmd/.circleci/telemetry.yml @@ -0,0 +1,4 @@ +is_enabled: false +has_answered_prompt: true +unique_id: ea33f5f1-a272-46e2-a596-db1e536ad4e9 +user_id: "" diff --git a/cmd/.circleci/update_check.yml b/cmd/.circleci/update_check.yml new file mode 100644 index 000000000..bcfb3dac8 --- /dev/null +++ b/cmd/.circleci/update_check.yml @@ -0,0 +1 @@ +last_update_check: 2023-10-17T14:50:25.397713+02:00 diff --git a/cmd/pipeline/usage_test.go b/cmd/pipeline/usage_test.go index 3be76f2da..42498ed10 100644 --- a/cmd/pipeline/usage_test.go +++ b/cmd/pipeline/usage_test.go @@ -2,6 +2,8 @@ package pipeline import ( "fmt" + "net/http" + "net/http/httptest" "testing" "github.com/spf13/cobra" @@ -11,8 +13,11 @@ import ( ) func TestUsage(t *testing.T) { + ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {})) + defer ts.Close() + preRunE := func(cmd *cobra.Command, args []string) error { return nil } - cmd := NewCommand(&settings.Config{}, preRunE) + cmd := NewCommand(&settings.Config{HTTPClient: ts.Client()}, preRunE) testSubCommandUsage(t, cmd.Name(), cmd) }