mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-21 10:51:29 +00:00
Update cmdutil_test.go
Modify error reporting format
This commit is contained in:
parent
20affda7f7
commit
d1dd3691c5
@ -17,8 +17,9 @@ limitations under the License.
|
|||||||
package util
|
package util
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"k8s.io/client-go/tools/clientcmd"
|
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
|
"k8s.io/client-go/tools/clientcmd"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestValidateExactArgNumber(t *testing.T) {
|
func TestValidateExactArgNumber(t *testing.T) {
|
||||||
@ -91,8 +92,13 @@ func TestGetKubeConfigPath(t *testing.T) {
|
|||||||
}
|
}
|
||||||
for _, tt := range tests {
|
for _, tt := range tests {
|
||||||
t.Run(tt.name, func(t *testing.T) {
|
t.Run(tt.name, func(t *testing.T) {
|
||||||
if GetKubeConfigPath(tt.file) != tt.expected {
|
actualResult := GetKubeConfigPath(tt.file)
|
||||||
t.Error("unexpected result")
|
if actualResult != tt.expected {
|
||||||
|
t.Errorf(
|
||||||
|
"failed GetKubeConfigPath:\n\texpected: %s\n\t actual: %s",
|
||||||
|
tt.expected,
|
||||||
|
actualResult,
|
||||||
|
)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user