1
0
mirror of https://gitlab.crans.org/nounous/ghostream.git synced 2025-06-28 13:12:46 +02:00

Test authentication

This commit is contained in:
Yohann D'ANELLO
2020-10-01 20:11:43 +02:00
parent 650040ef10
commit 1511884ee6
3 changed files with 55 additions and 0 deletions

View File

@ -1 +1,17 @@
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()
}