diff --git a/cmd/imageproxy-sign/main_test.go b/cmd/imageproxy-sign/main_test.go index 3108ee3..c6ac0e7 100644 --- a/cmd/imageproxy-sign/main_test.go +++ b/cmd/imageproxy-sign/main_test.go @@ -4,7 +4,6 @@ package main import ( - "io" "net/url" "os" "reflect" @@ -13,30 +12,6 @@ import ( var key = "secret" -func TestMainFunc(t *testing.T) { - os.Args = []string{"imageproxy-sign", "-key", key, "http://example.com/#0x0"} - r, w, err := os.Pipe() - if err != nil { - t.Errorf("error creating pipe: %v", err) - } - defer r.Close() - os.Stdout = w - - main() - w.Close() - - output, err := io.ReadAll(r) - got := string(output) - if err != nil { - t.Errorf("error reading from pipe: %v", err) - } - - want := "url: http://example.com/#0x0\nsignature: pwlnJ3bVazxg2nQxClimqT0VnNxUm5W0cdyg1HpKUPY=\n" - if got != want { - t.Errorf("main output %q, want %q", got, want) - } -} - func TestSign(t *testing.T) { s := "http://example.com/image.jpg#0x0"