Drop stale GetReason() and associated tests

This commit is contained in:
pancho horrillo
2019-11-20 04:54:07 +01:00
parent b40f73115f
commit 3a47b34bc1
2 changed files with 0 additions and 51 deletions
-42
View File
@@ -23,48 +23,6 @@ import (
"testing"
)
func TestEmptyReasonWhenEmptyString(t *testing.T) {
r := &nethttp.Response{Status: ""}
if GetReason(r) != "" {
t.Errorf("We consider an empty status line to have an empty reason")
}
}
func TestEmptyReasonWhenOnlyCode(t *testing.T) {
r := &nethttp.Response{Status: "200"}
if GetReason(r) != "" {
t.Errorf("We consider an status line with just the status code to have an empty reason")
}
}
func TestEmptyReasonWhenOnlyCodePlusSpace(t *testing.T) {
r := &nethttp.Response{Status: "200 "}
if GetReason(r) != "" {
t.Errorf("We consider an status line with just the status code to have an empty reason")
}
}
func TestReasonOfOneWord(t *testing.T) {
r := &nethttp.Response{Status: "200 FOO"}
if GetReason(r) != "FOO" {
t.Errorf("Unexpected reason found")
}
}
func TestReasonOfMultipleWords(t *testing.T) {
r := &nethttp.Response{Status: "200 FOO BAR BAZ"}
if GetReason(r) != "FOO BAR BAZ" {
t.Errorf("Unexpected reason found")
}
}
func TestBehaveWithOddSizeStatusCode(t *testing.T) {
r := &nethttp.Response{Status: "2 FOO BAR BAZ"}
if GetReason(r) != "FOO BAR BAZ" {
t.Errorf("Unexpected reason found")
}
}
func TestGetReasonFromBodyExtractsReasonFromJSON(t *testing.T) {
r := &nethttp.Response{
Status: "200 OK",