From f50b9a95efda72d664225fcef10d7dc612085d3c Mon Sep 17 00:00:00 2001 From: Hu Shuai Date: Tue, 12 May 2020 11:00:45 +0800 Subject: [PATCH] Add unit test for pkg/lint/rules/deprecations.go Signed-off-by: Hu Shuai --- pkg/lint/rules/deprecations_test.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pkg/lint/rules/deprecations_test.go b/pkg/lint/rules/deprecations_test.go index 1e8d34702..5e9ab27b0 100644 --- a/pkg/lint/rules/deprecations_test.go +++ b/pkg/lint/rules/deprecations_test.go @@ -40,3 +40,11 @@ func TestValidateNoDeprecations(t *testing.T) { 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) + } +}