faas/gateway/plugin/external_test.go
Alex Ellis (VMware) 811bbe6031 Apply gofmt
Previous PR from Simon or Ken broke build due to missing gofmt
in the PR. This PR applies it to resolve the build issue.

Signed-off-by: Alex Ellis (VMware) <alexellis2@gmail.com>
2018-04-11 20:46:20 -07:00

33 lines
721 B
Go

package plugin
import "testing"
const fallbackValue = 120
func TestLabelValueWasEmpty(t *testing.T) {
extractedValue := extractLabelValue("", fallbackValue)
if extractedValue != fallbackValue {
t.Log("Expected extractedValue to equal the fallbackValue")
t.Fail()
}
}
func TestLabelValueWasValid(t *testing.T) {
extractedValue := extractLabelValue("42", fallbackValue)
if extractedValue != 42 {
t.Log("Expected extractedValue to equal answer to life (42)")
t.Fail()
}
}
func TestLabelValueWasInValid(t *testing.T) {
extractedValue := extractLabelValue("InvalidValue", fallbackValue)
if extractedValue != fallbackValue {
t.Log("Expected extractedValue to equal the fallbackValue")
t.Fail()
}
}