change conf to argsset and flag for oauth
This commit is contained in:
@@ -3,6 +3,7 @@ package server
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"local/rproxy3/config"
|
||||
"local/rproxy3/storage"
|
||||
"net/http"
|
||||
"net/http/httptest"
|
||||
@@ -15,7 +16,10 @@ import (
|
||||
func TestServerStart(t *testing.T) {
|
||||
server := mockServer()
|
||||
|
||||
if err := server.Route("world", "http://hello.localhost"+server.addr); err != nil {
|
||||
p := config.Proxy{
|
||||
To: "http://hello.localhost" + server.addr,
|
||||
}
|
||||
if err := server.Route("world", p); err != nil {
|
||||
t.Fatalf("cannot add route: %v", err)
|
||||
}
|
||||
|
||||
@@ -48,7 +52,10 @@ func mockServer() *Server {
|
||||
|
||||
func TestServerRoute(t *testing.T) {
|
||||
server := mockServer()
|
||||
if err := server.Route("world", "http://hello.localhost"+server.addr); err != nil {
|
||||
p := config.Proxy{
|
||||
To: "http://hello.localhost" + server.addr,
|
||||
}
|
||||
if err := server.Route("world", p); err != nil {
|
||||
t.Fatalf("cannot add route: %v", err)
|
||||
}
|
||||
w := httptest.NewRecorder()
|
||||
|
||||
Reference in New Issue
Block a user