package drop import "testing" func TestDefaultConfigUsesPort10051(t *testing.T) { cfg := DefaultConfig() if cfg.Addr != ":10051" { t.Fatalf("default addr = %q, want :10051", cfg.Addr) } } func TestDefaultConfigReadsPublicURLs(t *testing.T) { t.Setenv("INTERNAL_DROP_PUBLIC_URLS", "http://10.20.8.138:10051, https://drop.company.lan ") cfg := DefaultConfig() want := []string{"http://10.20.8.138:10051", "https://drop.company.lan"} if len(cfg.PublicURLs) != len(want) { t.Fatalf("public urls = %#v, want %#v", cfg.PublicURLs, want) } for i := range want { if cfg.PublicURLs[i] != want[i] { t.Fatalf("public urls = %#v, want %#v", cfg.PublicURLs, want) } } }