Add Swarm limits

Signed-off-by: Alex Ellis <alexellis2@gmail.com>
This commit is contained in:
Alex Ellis
2017-11-12 19:26:54 +00:00
parent 9614b0b173
commit b17838ce51
9 changed files with 110 additions and 109 deletions

View File

@ -0,0 +1,20 @@
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)
}
}