Skip to content

Commit c562210

Browse files
committed
fix: non-TLS test case out of main loop in TestPrintResponseDebug
1 parent 6080649 commit c562210

1 file changed

Lines changed: 16 additions & 16 deletions

File tree

internal/requests/requests_test.go

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -984,24 +984,24 @@ func TestPrintResponseDebug(t *testing.T) {
984984
)
985985
}
986986
})
987+
}
987988

988-
t.Run("non-TLS", func(t *testing.T) {
989-
respURL := url.URL{Scheme: "http", Host: "localhost"}
990-
req := http.Request{URL: &respURL}
991-
resp := http.Response{
992-
StatusCode: 200,
993-
Request: &req,
994-
}
995-
rc := RequestConfig{ResponseDebug: true}
996-
buffer := bytes.Buffer{}
997-
rc.PrintResponseDebug(&buffer, &resp)
989+
t.Run("non-TLS", func(t *testing.T) {
990+
respURL := url.URL{Scheme: "http", Host: "localhost"}
991+
req := http.Request{URL: &respURL}
992+
resp := http.Response{
993+
StatusCode: 200,
994+
Request: &req,
995+
}
996+
rc := RequestConfig{ResponseDebug: true}
997+
buffer := bytes.Buffer{}
998+
rc.PrintResponseDebug(&buffer, &resp)
998999

999-
assert.True(t,
1000-
bytes.Contains(buffer.Bytes(), []byte("TLS: Not available")),
1001-
"check non-TLS connection",
1002-
)
1003-
})
1004-
}
1000+
assert.True(t,
1001+
bytes.Contains(buffer.Bytes(), []byte("TLS: Not available")),
1002+
"check non-TLS connection",
1003+
)
1004+
})
10051005
}
10061006

10071007
func TestPrintRequestDebug(t *testing.T) {

0 commit comments

Comments
 (0)