modify redirect test to include port

Signed-off-by: Andrew Hsu <andrewhsu@acm.org> (github: andrewhsu)
This commit is contained in:
Andrew Hsu 2016-04-25 11:40:21 -07:00 committed by Andrew Hsu
parent fba2e3a206
commit 3336cc13e4

View file

@ -24,20 +24,20 @@ func (s *MiddlewareSuite) TestMissingScheme(c *check.C) {
c.Assert(err, check.ErrorMatches, "no scheme specified for redirect baseurl") c.Assert(err, check.ErrorMatches, "no scheme specified for redirect baseurl")
} }
func (s *MiddlewareSuite) TestHTTPS(c *check.C) { func (s *MiddlewareSuite) TestHttpsPort(c *check.C) {
options := make(map[string]interface{}) options := make(map[string]interface{})
options["baseurl"] = "https://example.com" options["baseurl"] = "https://example.com:5443"
middleware, err := newRedirectStorageMiddleware(nil, options) middleware, err := newRedirectStorageMiddleware(nil, options)
c.Assert(err, check.Equals, nil) c.Assert(err, check.Equals, nil)
m, ok := middleware.(*redirectStorageMiddleware) m, ok := middleware.(*redirectStorageMiddleware)
c.Assert(ok, check.Equals, true) c.Assert(ok, check.Equals, true)
c.Assert(m.scheme, check.Equals, "https") c.Assert(m.scheme, check.Equals, "https")
c.Assert(m.host, check.Equals, "example.com") c.Assert(m.host, check.Equals, "example.com:5443")
url, err := middleware.URLFor(nil, "/rick/data", nil) url, err := middleware.URLFor(nil, "/rick/data", nil)
c.Assert(err, check.Equals, nil) c.Assert(err, check.Equals, nil)
c.Assert(url, check.Equals, "https://example.com/rick/data") c.Assert(url, check.Equals, "https://example.com:5443/rick/data")
} }
func (s *MiddlewareSuite) TestHTTP(c *check.C) { func (s *MiddlewareSuite) TestHTTP(c *check.C) {