mirror of
https://github.com/fnproject/fn.git
synced 2022-10-28 21:29:17 +03:00
Fixing tests and addressing comments
This commit is contained in:
@@ -115,6 +115,9 @@ func TestRoutePut(t *testing.T) {
|
|||||||
func TestRouteDelete(t *testing.T) {
|
func TestRouteDelete(t *testing.T) {
|
||||||
buf := setLogBuffer()
|
buf := setLogBuffer()
|
||||||
|
|
||||||
|
routes := models.Routes{{AppName: "a", Path: "/myroute",}}
|
||||||
|
apps := []*models.App{{Name: "a", Routes: routes, Config: nil}}
|
||||||
|
|
||||||
for i, test := range []struct {
|
for i, test := range []struct {
|
||||||
ds models.Datastore
|
ds models.Datastore
|
||||||
logDB models.FnLog
|
logDB models.FnLog
|
||||||
@@ -124,10 +127,7 @@ func TestRouteDelete(t *testing.T) {
|
|||||||
expectedError error
|
expectedError error
|
||||||
}{
|
}{
|
||||||
{datastore.NewMock(), logs.NewMock(), "/v1/apps/a/routes/missing", "", http.StatusNotFound, models.ErrRoutesNotFound},
|
{datastore.NewMock(), logs.NewMock(), "/v1/apps/a/routes/missing", "", http.StatusNotFound, models.ErrRoutesNotFound},
|
||||||
{datastore.NewMockInit(nil,
|
{datastore.NewMockInit(apps, routes, nil, nil,
|
||||||
[]*models.Route{
|
|
||||||
{Path: "/myroute", AppName: "a"},
|
|
||||||
}, nil, nil,
|
|
||||||
), logs.NewMock(), "/v1/apps/a/routes/myroute", "", http.StatusOK, nil},
|
), logs.NewMock(), "/v1/apps/a/routes/myroute", "", http.StatusOK, nil},
|
||||||
} {
|
} {
|
||||||
rnr, cancel := testRunner(t)
|
rnr, cancel := testRunner(t)
|
||||||
|
|||||||
Reference in New Issue
Block a user