Skip to content

Commit d5a9a9f

Browse files
committed
fix test
1 parent 8bc8114 commit d5a9a9f

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

pkg/jobs/export_evidence_test.go

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,6 @@ func fileDownloadServer(t *testing.T, files map[string][]byte) *httptest.Server
9797
}))
9898
}
9999

100-
// extractZipContents reads a zip from bytes and returns a map of path -> content.
101100
func extractZipContents(t *testing.T, data []byte) map[string]string {
102101
t.Helper()
103102

@@ -115,7 +114,14 @@ func extractZipContents(t *testing.T, data []byte) map[string]string {
115114

116115
rc.Close() //nolint:errcheck
117116

118-
result[f.Name] = buf.String()
117+
path := f.Name
118+
if idx := strings.Index(path, "/"); idx >= 0 {
119+
path = path[idx+1:]
120+
}
121+
122+
if path != "" {
123+
result[path] = buf.String()
124+
}
119125
}
120126

121127
return result
@@ -974,4 +980,3 @@ func TestExportEvidenceFiles_MissingRequiredArgs(t *testing.T) {
974980
})
975981
}
976982
}
977-

0 commit comments

Comments
 (0)