Add unit test for pkg/lint/rules/deprecations.go

Signed-off-by: Hu Shuai <hus.fnst@cn.fujitsu.com>
pull/8096/head
Hu Shuai 5 years ago
parent af52d35fb6
commit f50b9a95ef

@ -40,3 +40,11 @@ func TestValidateNoDeprecations(t *testing.T) {
t.Errorf("Expected a v1 Pod to not be deprecated") t.Errorf("Expected a v1 Pod to not be deprecated")
} }
} }
func TestDeprecatedAPIError(t *testing.T) {
expected := "the kind \"extensions/v1beta1 Deployment\" is deprecated in favor of \"apps/v1 Deployment\""
got := deprecatedAPIError{"extensions/v1beta1 Deployment", "apps/v1 Deployment"}.Error()
if expected != got {
t.Errorf("Expected %v, got %v", expected, got)
}
}

Loading…
Cancel
Save