New ๐ŸŒŠ wave for @helm

Commit b0ee91d5

b0ee91d51ea2Merged

Svyatoslav Dumchenko <[email protected]> ยท 4 years ago ยท 1 file ยท ~1 modified

Description

Add a bit more tests for Exec

Details

Commit
b0ee91d51ea2
Parent
777d31d7f05d

pkg/template/extra_test.gomodifiedView file

@@ -4,6 +4,7 @@
44
55 import (
66 "os"
7+ "os/exec"
78 "path/filepath"
89 "strings"
910 "testing"
@@ -88,6 +89,20 @@
8889 s.Require().Empty(res)
8990 }
9091
92+func (s *ExtraTestSuite) TestExecError() {
93+ res, err := Exec("pwd", []interface{}{"123"})
94+ expected := &exec.ExitError{}
95+ s.Require().ErrorAs(err, &expected)
96+ s.Require().Empty(res)
97+}
98+
99+func (s *ExtraTestSuite) TestExecStdin() {
100+ input := "123"
101+ res, err := Exec("cat", []interface{}{}, input)
102+ s.Require().NoError(err)
103+ s.Require().Equal(input, res)
104+}
105+
91106 func (s *ExtraTestSuite) TestSetValueAtPath() {
92107 data := Values{
93108 "a": map[string]interface{}{