1
0
mirror of https://github.com/kataras/iris.git synced 2025-12-17 09:57:01 +00:00
Read HISTORY.md
This commit is contained in:
Gerasimos Maropoulos
2016-09-27 16:28:38 +03:00
parent 70d81e6843
commit 5c98c5a493
16 changed files with 1160 additions and 2273 deletions

View File

@@ -67,15 +67,15 @@ func TestConfigOptionsDeep(t *testing.T) {
cookiename := "MYSESSIONID"
charset := "MYCHARSET"
dev := true
profilePath := "/mypprof"
vhost := "mydomain.com"
// first session, after charset,dev and profilepath, no canonical order.
api := New(OptionSessionsCookie(cookiename), OptionCharset(charset), OptionIsDevelopment(dev), OptionProfilePath(profilePath))
api := New(OptionSessionsCookie(cookiename), OptionCharset(charset), OptionIsDevelopment(dev), OptionVHost(vhost))
expected := DefaultConfiguration()
expected.Sessions.Cookie = cookiename
expected.Charset = charset
expected.IsDevelopment = dev
expected.ProfilePath = profilePath
expected.VHost = vhost
has := *api.Config
@@ -83,20 +83,3 @@ func TestConfigOptionsDeep(t *testing.T) {
t.Fatalf("DEEP configuration is not the same after New expected:\n %#v \ngot:\n %#v", expected, has)
}
}
// ServerConfiguration is independent so make a small test for that
func TestConfigServerOptions(t *testing.T) {
expected := DefaultServerConfiguration()
expected.ListeningAddr = "mydomain.com:80"
expected.RedirectTo = "https://mydomain.com:443"
expected.Virtual = true
c := ServerConfiguration{ListeningAddr: expected.ListeningAddr, RedirectTo: expected.RedirectTo, Virtual: expected.Virtual}
// static config test
s := newServer(c)
if !reflect.DeepEqual(s.Config, expected) {
t.Fatalf("Static Server Configuration not equal after newServer, expected:\n%#v \nwhile got:\n%#v", expected, s.Config)
}
}