Use v2.0.0 of mq-golang now it has been created (#159)
* Use v2.0.0 of mq-golang now it has been created * do a strip vendor
This commit is contained in:
committed by
Stephen Marshall
parent
59eaa9c7d2
commit
e4f02d55cf
26
vendor/github.com/prometheus/common/config/http_config_test.go
generated
vendored
26
vendor/github.com/prometheus/common/config/http_config_test.go
generated
vendored
@@ -476,6 +476,32 @@ func TestBasicAuthNoPassword(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestBasicAuthNoUsername(t *testing.T) {
|
||||
cfg, _, err := LoadHTTPConfigFile("testdata/http.conf.basic-auth.no-username.yaml")
|
||||
if err != nil {
|
||||
t.Errorf("Error loading HTTP client config: %v", err)
|
||||
}
|
||||
client, err := NewClientFromConfig(*cfg, "test")
|
||||
if err != nil {
|
||||
t.Errorf("Error creating HTTP Client: %v", err)
|
||||
}
|
||||
|
||||
rt, ok := client.Transport.(*basicAuthRoundTripper)
|
||||
if !ok {
|
||||
t.Fatalf("Error casting to basic auth transport, %v", client.Transport)
|
||||
}
|
||||
|
||||
if rt.username != "" {
|
||||
t.Errorf("Got unexpected username: %s", rt.username)
|
||||
}
|
||||
if string(rt.password) != "secret" {
|
||||
t.Errorf("Unexpected HTTP client password: %s", string(rt.password))
|
||||
}
|
||||
if string(rt.passwordFile) != "" {
|
||||
t.Errorf("Expected empty HTTP client passwordFile: %s", rt.passwordFile)
|
||||
}
|
||||
}
|
||||
|
||||
func TestBasicAuthPasswordFile(t *testing.T) {
|
||||
cfg, _, err := LoadHTTPConfigFile("testdata/http.conf.basic-auth.good.yaml")
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user