mirror of
https://gitlab.crans.org/nounous/ghostream.git
synced 2024-12-22 18:32:19 +00:00
18 lines
414 B
Go
18 lines
414 B
Go
package basic
|
|
|
|
import (
|
|
"testing"
|
|
)
|
|
|
|
func TestBasicLogin(t *testing.T) {
|
|
basicCredentials := make(map[string]string)
|
|
basicCredentials["demo"] = "$2b$15$LRnG3eIHFlYIguTxZOLH7eHwbQC/vqjnLq6nDFiHSUDKIU.f5/1H6"
|
|
|
|
backend, _ := New(&Options{Credentials: basicCredentials})
|
|
ok, err := backend.Login("demo", "demo")
|
|
if !ok {
|
|
t.Error("Error while logging with the basic authentication:", err)
|
|
}
|
|
backend.Close()
|
|
}
|