MCPcopy Create free account
hub / github.com/apache/openwhisk-cli / TestBallerinaBinaryFile

Function TestBallerinaBinaryFile

commands/action_test.go:29–51  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

27)
28
29func TestBallerinaBinaryFile(t *testing.T) {
30 file := "file.balx"
31 args := []string{"name", file}
32 parms := ActionFlags{}
33
34 f, error := os.Create(file)
35 if error != nil {
36 t.Fatalf("could not create file: %s", error.Error())
37 }
38 d := []byte("balx")
39 f.Write(d)
40 f.Close()
41
42 exec, error := getExec(args, parms)
43 os.Remove(file)
44
45 if error != nil {
46 t.Errorf("unexpected exec error: %s", error.Error())
47 } else {
48 assert.Equal(t, exec.Kind, "ballerina:default")
49 assert.Equal(t, base64.StdEncoding.EncodeToString(d), *exec.Code)
50 }
51}

Callers

nothing calls this directly

Calls 2

getExecFunction · 0.85
CreateMethod · 0.80

Tested by

no test coverage detected