fix datastore Put and added tests (#402)

This commit is contained in:
Pedro Nasser
2016-12-07 14:59:54 -02:00
committed by Travis Reeder
parent 0baf03841f
commit 9382f0b133
6 changed files with 132 additions and 37 deletions

View File

@@ -0,0 +1,31 @@
package datastore
import (
"bytes"
"github.com/Sirupsen/logrus"
"github.com/gin-gonic/gin"
"github.com/iron-io/functions/api/models"
"log"
)
func setLogBuffer() *bytes.Buffer {
var buf bytes.Buffer
buf.WriteByte('\n')
logrus.SetOutput(&buf)
gin.DefaultErrorWriter = &buf
gin.DefaultWriter = &buf
log.SetOutput(&buf)
return &buf
}
var testApp = &models.App{
Name: "Test",
}
var testRoute = &models.Route{
AppName: testApp.Name,
Path: "/test",
Image: "iron/hello",
Type: "sync",
Format: "http",
}