mirror of
https://github.com/wneessen/go-hibp.git
synced 2024-11-23 05:10:50 +01:00
Wrong type in Errorf()
This commit is contained in:
parent
f7588a863c
commit
a50a8603eb
1 changed files with 15 additions and 0 deletions
15
hibp_test.go
15
hibp_test.go
|
@ -1,6 +1,7 @@
|
||||||
package hibp
|
package hibp
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"os"
|
||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
)
|
)
|
||||||
|
@ -38,3 +39,17 @@ func TestNewWithPwnedPadding(t *testing.T) {
|
||||||
true, hc.PwnedPassApiOpts.WithPadding)
|
true, hc.PwnedPassApiOpts.WithPadding)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TestNewWithApiKey tests the New() function with the API key set
|
||||||
|
func TestNewWithApiKey(t *testing.T) {
|
||||||
|
apiKey := os.Getenv("HIBP_API_KEY")
|
||||||
|
hc := New(WithApiKey(apiKey))
|
||||||
|
if hc == nil {
|
||||||
|
t.Errorf("hibp client creation failed")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if hc.ak != apiKey {
|
||||||
|
t.Errorf("hibp client API key was not set properly. Expected %s, got: %s",
|
||||||
|
apiKey, hc.ak)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue