提交 d4740583 编写于 作者: A alonyb

restore unittest

上级 277e0961
...@@ -41,7 +41,7 @@ import ( ...@@ -41,7 +41,7 @@ import (
func showVersionInfo(k8sVersion string, cr cruntime.Manager) { func showVersionInfo(k8sVersion string, cr cruntime.Manager) {
version, _ := cr.Version() version, _ := cr.Version()
register.Reg.SetStep(register.PreparingKubernetes) register.Reg.SetStep(register.PreparingKubernetes)
out.Step(cr.Style(),"Preparing Kubernetes {{.k8sVersion}} on {{.runtime}} {{.runtimeVersion}} ...", out.V{"k8sVersion": k8sVersion, "runtime": cr.Name(), "runtimeVersion": version}) out.Step(cr.Style(), "Preparing Kubernetes {{.k8sVersion}} on {{.runtime}} {{.runtimeVersion}} ...", out.V{"k8sVersion": k8sVersion, "runtime": cr.Name(), "runtimeVersion": version})
for _, v := range config.DockerOpt { for _, v := range config.DockerOpt {
out.Infof("opt {{.docker_option}}", out.V{"docker_option": v}) out.Infof("opt {{.docker_option}}", out.V{"docker_option": v})
} }
......
...@@ -83,7 +83,7 @@ func TestApplyStyle(t *testing.T) { ...@@ -83,7 +83,7 @@ func TestApplyStyle(t *testing.T) {
} }
for _, test := range tests { for _, test := range tests {
t.Run(test.description, func(t *testing.T) { t.Run(test.description, func(t *testing.T) {
rawGot := applyStyle(test.styleEnum, test.useColor, test.format, false) rawGot, _ := applyStyle(test.styleEnum, test.useColor, test.format)
got := strings.TrimSpace(rawGot) got := strings.TrimSpace(rawGot)
if got != test.expected { if got != test.expected {
t.Errorf("Expected '%v' but got '%v'", test.expected, got) t.Errorf("Expected '%v' but got '%v'", test.expected, got)
...@@ -139,7 +139,7 @@ func TestApplyTemplateFormating(t *testing.T) { ...@@ -139,7 +139,7 @@ func TestApplyTemplateFormating(t *testing.T) {
} }
for _, test := range tests { for _, test := range tests {
t.Run(test.description, func(t *testing.T) { t.Run(test.description, func(t *testing.T) {
rawGot := stylized(test.styleEnum, test.useColor, false, test.format, test.a...) rawGot, _ := stylized(test.styleEnum, test.useColor, test.format, test.a...)
got := strings.TrimSpace(rawGot) got := strings.TrimSpace(rawGot)
if got != test.expected { if got != test.expected {
t.Errorf("Expected '%v' but got '%v'", test.expected, got) t.Errorf("Expected '%v' but got '%v'", test.expected, got)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册