small fix, don't worry about it

This commit is contained in:
Tomas Dvorak
2026-04-10 12:02:36 +02:00
parent 08bd0c6e5c
commit 08cb5754f3
638 changed files with 57332 additions and 34706 deletions
@@ -0,0 +1,21 @@
package commands
import (
"testing"
"github.com/spf13/viper"
)
func TestBuildAPIURLDefaultsAndTrimming(t *testing.T) {
viper.Set("api-url", "")
got := buildAPIURL("/user/profile")
if got != "http://localhost:8080/api/v1/user/profile" {
t.Fatalf("unexpected default api url: %s", got)
}
viper.Set("api-url", "https://api.example.com/api/v1/")
got = buildAPIURL("user/profile")
if got != "https://api.example.com/api/v1/user/profile" {
t.Fatalf("unexpected trimmed api url: %s", got)
}
}