mirror of
https://github.com/fnproject/fn.git
synced 2022-10-28 21:29:17 +03:00
fix datastore Put and added tests (#402)
This commit is contained in:
committed by
Travis Reeder
parent
0baf03841f
commit
9382f0b133
31
api/datastore/datastore_test.go
Normal file
31
api/datastore/datastore_test.go
Normal 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",
|
||||
}
|
||||
Reference in New Issue
Block a user