From 83cf41155646380d3df4037d3f2ac683147f194a Mon Sep 17 00:00:00 2001 From: Tyler McGoffin Date: Tue, 19 Nov 2024 16:08:31 -0800 Subject: [PATCH] Improve test names so there is no repetition --- pkg/cmd/run/download/download_test.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/pkg/cmd/run/download/download_test.go b/pkg/cmd/run/download/download_test.go index f07d66128..fb445ccd4 100644 --- a/pkg/cmd/run/download/download_test.go +++ b/pkg/cmd/run/download/download_test.go @@ -290,7 +290,7 @@ func Test_runDownload(t *testing.T) { }, }, { - name: "given artifact name contains `..`, verify an error about path traversal is returned", + name: "given artifact name contains `..` and the DestinationDir is `.`, verify an error about path traversal is returned", opts: DownloadOptions{ RunID: "2345", DestinationDir: ".", @@ -307,7 +307,7 @@ func Test_runDownload(t *testing.T) { wantErr: "error downloading ..: would result in path traversal", }, { - name: "given artifact name contains `..`, verify an error about path traversal is returned", + name: "given artifact name contains `..` and the DestinationDir is `imaginary-dir`, verify an error about path traversal is returned", opts: DownloadOptions{ RunID: "2345", DestinationDir: "imaginary-dir", @@ -324,7 +324,7 @@ func Test_runDownload(t *testing.T) { wantErr: "error downloading ..: would result in path traversal", }, { - name: "given artifact name contains `../etc/passwd`, verify an error about path traversal is returned", + name: "given artifact name contains `../etc/passwd` and the DestinationDir is `.`, verify an error about path traversal is returned", opts: DownloadOptions{ RunID: "2345", DestinationDir: ".", @@ -341,7 +341,7 @@ func Test_runDownload(t *testing.T) { wantErr: "error downloading ../etc/passwd: would result in path traversal", }, { - name: "given artifact name contains `../etc/passwd`, verify an error about path traversal is returned", + name: "given artifact name contains `../etc/passwd` and the DestinationDir is `imaginary-dir`, verify an error about path traversal is returned", opts: DownloadOptions{ RunID: "2345", DestinationDir: "imaginary-dir", @@ -358,7 +358,7 @@ func Test_runDownload(t *testing.T) { wantErr: "error downloading ../etc/passwd: would result in path traversal", }, { - name: "given artifact name contains `../../etc/passwd`, verify an error about path traversal is returned", + name: "given artifact name contains `../../etc/passwd` and the DestinationDir is `.`, verify an error about path traversal is returned", opts: DownloadOptions{ RunID: "2345", DestinationDir: ".", @@ -375,7 +375,7 @@ func Test_runDownload(t *testing.T) { wantErr: "error downloading ../../etc/passwd: would result in path traversal", }, { - name: "given artifact name contains `../../etc/passwd`, verify an error about path traversal is returned", + name: "given artifact name contains `../../etc/passwd` and the DestinationDir is `imaginary-dir`, verify an error about path traversal is returned", opts: DownloadOptions{ RunID: "2345", DestinationDir: "imaginary-dir",