File tree Expand file tree Collapse file tree 2 files changed +8
-10
lines changed Expand file tree Collapse file tree 2 files changed +8
-10
lines changed Original file line number Diff line number Diff line change @@ -23,7 +23,6 @@ import (
23
23
"path/filepath"
24
24
"testing"
25
25
26
- "github.com/stretchr/testify/assert"
27
26
"github.com/stretchr/testify/require"
28
27
29
28
"k8s.io/enhancements/api"
@@ -98,19 +97,19 @@ func TestWriteKep(t *testing.T) {
98
97
err = c .writeKEP (& p , & tc .opts .CommonArgs )
99
98
100
99
if tc .expectError {
101
- assert .Error (t , err )
100
+ require .Error (t , err )
102
101
} else {
103
- assert .NoError (t , err )
102
+ require .NoError (t , err )
104
103
105
104
computedPath := filepath .Join (tempDir , tc .expectedPath )
106
105
dirStat , err := os .Stat (computedPath )
107
- assert .NoError (t , err )
106
+ require .NoError (t , err )
108
107
require .NotNil (t , dirStat )
109
- assert .True (t , dirStat .IsDir ())
108
+ require .True (t , dirStat .IsDir ())
110
109
p := filepath .Join (computedPath , "kep.yaml" )
111
110
fileStat , err := os .Stat (p )
112
- assert .NoError (t , err )
113
- assert .NotNil (t , fileStat )
111
+ require .NoError (t , err )
112
+ require .NotNil (t , fileStat )
114
113
}
115
114
})
116
115
}
Original file line number Diff line number Diff line change @@ -21,7 +21,6 @@ import (
21
21
"io/ioutil"
22
22
"testing"
23
23
24
- "github.com/stretchr/testify/assert"
25
24
"github.com/stretchr/testify/require"
26
25
"gopkg.in/yaml.v2"
27
26
@@ -55,9 +54,9 @@ func TestValidate(t *testing.T) {
55
54
require .NoError (t , err )
56
55
err = validateKEP (& p )
57
56
if tc .err == nil {
58
- assert .NoError (t , err )
57
+ require .NoError (t , err )
59
58
} else {
60
- assert .EqualError (t , err , tc .err .Error ())
59
+ require .EqualError (t , err , tc .err .Error ())
61
60
}
62
61
})
63
62
}
You can’t perform that action at this time.
0 commit comments