From 46e958ab6e4ecabdb7f93a725f9904fe0cef633c Mon Sep 17 00:00:00 2001 From: ashvinctrl Date: Fri, 25 Sep 2026 21:17:53 +0530 Subject: [PATCH] test(downloader): assert a rejected chart leaves nothing in dest Signed-off-by: ashvinctrl --- pkg/downloader/chart_downloader_test.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkg/downloader/chart_downloader_test.go b/pkg/downloader/chart_downloader_test.go index 8acb22025..9ff69fedd 100644 --- a/pkg/downloader/chart_downloader_test.go +++ b/pkg/downloader/chart_downloader_test.go @@ -565,6 +565,11 @@ func TestDownloadTo_RejectsChartNotMatchingIndexDigest(t *testing.T) { _, _, err := c.DownloadTo("test/signtest", "0.1.0", dest) require.Error(t, err, "a chart that does not match the index digest must not be accepted") assert.Contains(t, err.Error(), "does not match the digest recorded for it in the repository index") + + // Nothing may be left behind in dest for a later step to pick up. + entries, err := os.ReadDir(dest) + require.NoError(t, err) + assert.Empty(t, entries, "rejected chart must not be written to the destination") } func TestDownloadToCache_RejectsChartNotMatchingIndexDigest(t *testing.T) {