mirror of
https://github.com/openfaas/faas.git
synced 2025-06-09 08:46:48 +00:00
28 lines
509 B
Go
28 lines
509 B
Go
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()
|
|
}
|
|
}
|