-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
stick our error details in our response instead of description
- Loading branch information
1 parent
f497ebf
commit 382af9a
Showing
2 changed files
with
29 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package utils | ||
|
||
import "testing" | ||
|
||
func TestClient(t *testing.T) { | ||
client := GetHTTPClient() | ||
if client == nil { | ||
t.Error("Client should not be nil") | ||
} | ||
|
||
insecureClient := GetInsecureHTTPClient() | ||
if insecureClient == nil { | ||
t.Error("Insecure client should not be nil") | ||
} | ||
|
||
if client == insecureClient || client.Transport == insecureClient.Transport { | ||
t.Error("Client and insecure client should not be the same") | ||
} | ||
|
||
client2 := GetHTTPClient() | ||
if client != client2 { | ||
t.Error("GetHTTPClient should always return same client") | ||
} | ||
} |