MCPcopy
hub / github.com/willnorris/imageproxy / TestProxy_log_default

Function TestProxy_log_default

imageproxy_test.go:698–722  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

696}
697
698func TestProxy_log_default(t *testing.T) {
699 var b strings.Builder
700
701 defer func(flags int) {
702 log.SetOutput(os.Stderr)
703 log.SetFlags(flags)
704 }(log.Flags())
705
706 log.SetOutput(&b)
707 log.SetFlags(0)
708
709 p := &Proxy{}
710 p.log("Test")
711
712 if got, want := b.String(), "Test\n"; got != want {
713 t.Errorf("log wrote %s, want %s", got, want)
714 }
715
716 b.Reset()
717 p.logf("Test %v", 123)
718
719 if got, want := b.String(), "Test 123\n"; got != want {
720 t.Errorf("logf wrote %s, want %s", got, want)
721 }
722}
723
724func TestTransformingTransport(t *testing.T) {
725 client := new(http.Client)

Callers

nothing calls this directly

Calls 3

logMethod · 0.95
logfMethod · 0.95
StringMethod · 0.45

Tested by

no test coverage detected