mirror of
https://github.com/openfaas/faas.git
synced 2025-06-24 07:43:25 +00:00
Move handlers into ./handlers
This commit is contained in:
27
gateway/tests/isalexa_test.go
Normal file
27
gateway/tests/isalexa_test.go
Normal file
@ -0,0 +1,27 @@
|
||||
package tests
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"io/ioutil"
|
||||
|
||||
"github.com/alexellis/faas/gateway/handlers"
|
||||
"github.com/alexellis/faas/gateway/requests"
|
||||
)
|
||||
|
||||
func TestIsAlexa(t *testing.T) {
|
||||
requestBody, _ := ioutil.ReadFile("./alexhostname_request.json")
|
||||
var result requests.AlexaRequestBody
|
||||
|
||||
result = handlers.IsAlexa(requestBody)
|
||||
|
||||
if len(result.Session.Application.ApplicationId) == 0 {
|
||||
t.Fail()
|
||||
}
|
||||
if len(result.Session.SessionId) == 0 {
|
||||
t.Fail()
|
||||
}
|
||||
if len(result.Request.Intent.Name) == 0 {
|
||||
t.Fail()
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user