t.Fatalf("get session should return %d when 'Authorization' header '%s' is found but returned: %d (%s)",vector.code,vector.token,rr.Code,http.StatusText(rr.Code))
}
}
}
funcTestAuthWaitForLogin(t*testing.T){
cfg:=&Config{}
iferr:=Init(cfg,nil,nil,nil);err!=nil{
t.Fatalf("unexpected error: %v",err)
}
ifauth.sessions==nil{
t.Fatalf("authentication should be enabled but Init created no session manager")
}
s,err:=NewSession()
iferr!=nil{
t.Fatalf("unexpected error: %v",err)
}
iferr=auth.sessions.insert(s);err!=nil{
t.Fatalf("unexpected error: %v",err)
}
router:=mux.NewRouter()
InstallHTTPHandler(router)
timeout:=time.AfterFunc(time.Second,func(){
t.Fatalf("waiting for session state change does not respect the request context")