mirror of
https://github.com/Dvorinka/Containr.git
synced 2026-06-04 12:32:58 +00:00
small fix, don't worry about it
This commit is contained in:
@@ -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)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user