forked from grassrootseconomics/visedriver
		
	Rehabilitate all tets
This commit is contained in:
		
							parent
							
								
									f0a4a0df61
								
							
						
					
					
						commit
						437f73827d
					
				| @ -21,7 +21,6 @@ import ( | ||||
| 	httpserver "git.grassecon.net/urdt/ussd/internal/http" | ||||
| 	"git.grassecon.net/urdt/ussd/internal/storage" | ||||
| 	"git.grassecon.net/urdt/ussd/remote" | ||||
| 	"git.grassecon.net/urdt/ussd/request" | ||||
| ) | ||||
| 
 | ||||
| var ( | ||||
| @ -124,7 +123,11 @@ func main() { | ||||
| 
 | ||||
| 	rp := &httpserver.DefaultRequestParser{} | ||||
| 	bsh := handlers.NewBaseSessionHandler(cfg, rs, stateStore, userdataStore, rp, hl) | ||||
| 	sh := request.ToSessionHandler(bsh) | ||||
| 	// TODO: less hacky way of making session handler
 | ||||
| 	//sh := request.ToSessionHandler(bsh)
 | ||||
| 	sh := &httpserver.SessionHandler{ | ||||
| 		RequestHandler: bsh, | ||||
| 	} | ||||
| 	s := &http.Server{ | ||||
| 		Addr:    fmt.Sprintf("%s:%s", host, strconv.Itoa(int(port))), | ||||
| 		Handler: sh, | ||||
|  | ||||
| @ -98,7 +98,10 @@ func TestSessionHandler_ServeHTTP(t *testing.T) { | ||||
| 				}, | ||||
| 			} | ||||
| 
 | ||||
| 			sessionHandler := request.ToSessionHandler(mockRequestHandler) | ||||
| 			sessionHandler := &SessionHandler{ | ||||
| 				RequestHandler: mockRequestHandler, | ||||
| 			} | ||||
| 			//sessionHandler := request.ToSessionHandler(mockRequestHandler)
 | ||||
| 
 | ||||
| 			req := httptest.NewRequest(http.MethodPost, "/", bytes.NewBuffer(tt.input)) | ||||
| 			req.Header.Set("X-Vise-Session", tt.sessionID) | ||||
|  | ||||
| @ -2,7 +2,6 @@ package request | ||||
| 
 | ||||
| import ( | ||||
| 	"context" | ||||
| 	"fmt" | ||||
| 	"io" | ||||
| 	"net/http" | ||||
| 	"strconv" | ||||
| @ -59,10 +58,6 @@ func (f *SessionHandler) WriteError(w http.ResponseWriter, code int, err error) | ||||
| 	} | ||||
| } | ||||
| 
 | ||||
| func (f *SessionHandler) ServeHTTP(w http.ResponseWriter, req *http.Request) { | ||||
| 	f.WriteError(w, 500, fmt.Errorf("not implemented")) | ||||
| } | ||||
| 
 | ||||
| func ToSessionHandler(h RequestHandler) *SessionHandler { | ||||
| 	return &SessionHandler{ | ||||
| 		RequestHandler: h, | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user