added ctx to datastore and improve mock (#329)

Added ctx to datastore and improved mock
This commit is contained in:
Pedro Nasser
2016-11-22 03:33:44 -02:00
committed by GitHub
parent 5e61d2b055
commit c14bc323f9
23 changed files with 292 additions and 229 deletions

View File

@@ -26,7 +26,7 @@ func TestRouteRunnerGet(t *testing.T) {
tasks := mockTasksConduit()
router := testRouter(&datastore.Mock{
FakeApps: []*models.App{
Apps: []*models.App{
{Name: "myapp", Config: models.Config{}},
},
}, &mqs.Mock{}, testRunner(t), tasks)
@@ -66,7 +66,7 @@ func TestRouteRunnerPost(t *testing.T) {
tasks := mockTasksConduit()
router := testRouter(&datastore.Mock{
FakeApps: []*models.App{
Apps: []*models.App{
{Name: "myapp", Config: models.Config{}},
},
}, &mqs.Mock{}, testRunner(t), tasks)
@@ -113,10 +113,10 @@ func TestRouteRunnerExecution(t *testing.T) {
go runner.StartWorkers(ctx, testRunner(t), tasks)
router := testRouter(&datastore.Mock{
FakeApps: []*models.App{
Apps: []*models.App{
{Name: "myapp", Config: models.Config{}},
},
FakeRoutes: []*models.Route{
Routes: []*models.Route{
{Path: "/myroute", AppName: "myapp", Image: "iron/hello", Headers: map[string][]string{"X-Function": {"Test"}}},
{Path: "/myerror", AppName: "myapp", Image: "iron/error", Headers: map[string][]string{"X-Function": {"Test"}}},
},