fix failed test due img proxy nil pointer

This commit is contained in:
Umputun
2018-05-23 12:14:36 -05:00
parent 5f6a329609
commit 146a930b23
+3 -1
View File
@@ -462,7 +462,8 @@ func TestServer_FileServer(t *testing.T) {
}
func TestServer_Shutdown(t *testing.T) {
srv := Rest{Authenticator: auth.Authenticator{}, AvatarProxy: &proxy.Avatar{StorePath: "/tmp", RoutePath: "/api/v1/avatar"}}
srv := Rest{Authenticator: auth.Authenticator{},
AvatarProxy: &proxy.Avatar{StorePath: "/tmp", RoutePath: "/api/v1/avatar"}, ImageProxy: &proxy.Image{}}
go func() {
time.Sleep(100 * time.Millisecond)
srv.Shutdown()
@@ -487,6 +488,7 @@ func prep(t *testing.T) (srv *Rest, ts *httptest.Server) {
Cache: &mockCache{},
WebRoot: "/tmp",
AvatarProxy: &proxy.Avatar{StorePath: "/tmp", RoutePath: "/api/v1/avatar"},
ImageProxy: &proxy.Image{},
}
srv.ScoreThresholds.Low, srv.ScoreThresholds.Critical = -5, -10