Files
fn-serverless/cli/routes_test.go
Travis Reeder 48e3781d5e Rename to GitHub (#3)
* circle

* Rename to github and fn->cli

*  Rename to github and fn->cli
2017-07-26 10:50:19 -07:00

27 lines
517 B
Go

package main
import (
"github.com/fnproject/fn/cli/client"
"net/http"
"os"
"testing"
)
func TestEnvAsHeader(t *testing.T) {
const expectedValue = "v=v"
os.Setenv("k", expectedValue)
cases := [][]string{
nil,
[]string{},
[]string{"k"},
}
for _, selectedEnv := range cases {
req, _ := http.NewRequest("GET", "http://www.example.com", nil)
client.EnvAsHeader(req, selectedEnv)
if found := req.Header.Get("k"); found != expectedValue {
t.Errorf("not found expected header: %v", found)
}
}
}