refactor(backend): rename mediacore package to media
This commit is contained in:
1 parent
e8cb7c6c68
commit
75c08beec6
34 files changed
+837
-656
No files matched your search
@@ -0,0 +1,24 @@
|
||||
package settings
|
||||
|
||||
import (
|
||||
"context"
|
||||
"testing"
|
||||
|
||||
"github.com/jackc/pgx/v5/pgxpool"
|
||||
)
|
||||
|
||||
func TestSettingValueReturnsDatabaseErrors(t *testing.T) {
|
||||
db, err := pgxpool.New(context.Background(), "postgres://nobody@127.0.0.1:1/none?sslmode=disable&connect_timeout=1")
|
||||
if err != nil {
|
||||
t.Fatalf("pgxpool.New: %v", err)
|
||||
}
|
||||
defer db.Close()
|
||||
|
||||
value, err := Value(context.Background(), db, "example", "fallback")
|
||||
if err == nil || value != "" {
|
||||
t.Fatalf("Value() = %q, %v; want empty value and database error", value, err)
|
||||
}
|
||||
if got := ValueOrFallback(context.Background(), db, "example", "fallback"); got != "fallback" {
|
||||
t.Fatalf("ValueOrFallback() = %q, want fallback on error", got)
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user