faas/gateway/tests/resources_test.go
Alex Ellis b17838ce51 Add Swarm limits
Signed-off-by: Alex Ellis <alexellis2@gmail.com>
2017-11-15 08:42:00 +00:00

21 lines
292 B
Go

package tests
import (
"testing"
"github.com/openfaas/faas/gateway/handlers"
)
func Test_ParseMemory(t *testing.T) {
value := "512 m"
val, err := handlers.ParseMemory(value)
if err != nil {
t.Error(err)
}
if val != 1024*1024*512 {
t.Errorf("want: %d got: %d", 1024, val)
}
}