From ba1195afeb86a501e87c4df0c371f811575d3508 Mon Sep 17 00:00:00 2001 From: Claudiu Belu Date: Wed, 7 Dec 2022 11:36:13 +0000 Subject: [PATCH] unittests: Fixes TestReplaceFile for Windows Currently, the test TestReplaceFile/neither_parent_nor_file_exists fails because the error encountered doesn't match the expected error. On Windows, if a file is missing, the encountered error is: The system cannot find the file specified. And if a folder / parent folder is missing, this error is encoutered instead: The system cannot find the path specified. --- pkg/kubelet/kubeletconfig/util/files/files_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/kubelet/kubeletconfig/util/files/files_test.go b/pkg/kubelet/kubeletconfig/util/files/files_test.go index eb8f31bd4ec..20d91349f99 100644 --- a/pkg/kubelet/kubeletconfig/util/files/files_test.go +++ b/pkg/kubelet/kubeletconfig/util/files/files_test.go @@ -313,7 +313,7 @@ func TestReplaceFile(t *testing.T) { return nil }, desc: "neither parent nor file exists", - err: missingFileError, + err: missingFolderError, }, } for _, c := range cases {