follow sql schema

This commit is contained in:
venture
2026-11-14 09:52:18 +01:00
parent f7649f24ef
commit 276a9fe320
23 changed files with 855 additions and 548 deletions
+37
View File
@@ -0,0 +1,37 @@
package node
import (
"context"
"testing"
"mediarr/auth"
)
func TestNodeAuth(t *testing.T) {
t.Chdir(t.TempDir())
err, node := NewNode(NewNodeParams{DatabaseName: "users"})
if err != nil {
t.Fatalf("NewNode : %v", err)
}
t.Cleanup(func() {
if err := node.Close(); err != nil {
t.Errorf("Close : %v", err)
}
})
if err := node.Up(); err != nil {
t.Fatalf("Up : %v", err)
}
created, err := node.Auth().CreateUser(context.Background(), auth.CreateUserParams{
Login: "alice",
Password: "correct horse battery staple",
})
if err != nil {
t.Fatalf("CreateUser : %v", err)
}
if created.Account.Login != "alice" {
t.Fatalf("login = %q, attendu alice", created.Account.Login)
}
}