@@ -46,16 +46,23 @@ func Test_extractZIP(t *testing.T) {
4646 files []string
4747 }{
4848 {
49- in : "test-with-directory.zip" ,
49+ in : "test-flat-hierarchy.zip" ,
50+ files : []string {
51+ "/foo" ,
52+ },
53+ },
54+ {
55+ in : "test-with-directory-entry.zip" ,
5056 files : []string {
5157 "/test/" ,
5258 "/test/foo" ,
5359 },
5460 },
5561 {
56- in : "test-without- directory.zip" ,
62+ in : "test-with-no- directory-entry .zip" ,
5763 files : []string {
58- "/foo" ,
64+ "/test/" ,
65+ "/test/foo" ,
5966 },
6067 },
6168 }
@@ -88,18 +95,18 @@ func Test_extractTARGZ(t *testing.T) {
8895 files []string
8996 }{
9097 {
91- in : "test-without-directory .tar.gz" ,
98+ in : "test-flat-hierarchy .tar.gz" ,
9299 files : []string {"/foo" },
93100 },
94101 {
95- in : "test-with-nesting-with- directory-entries .tar.gz" ,
102+ in : "test-with-directory-entry .tar.gz" ,
96103 files : []string {
97104 "/test/" ,
98105 "/test/foo" ,
99106 },
100107 },
101108 {
102- in : "test-with-nesting-without- directory-entries .tar.gz" ,
109+ in : "test-with-no- directory-entry .tar.gz" ,
103110 files : []string {
104111 "/test/" ,
105112 "/test/foo" ,
@@ -173,9 +180,9 @@ func TestDownloader_Get(t *testing.T) {
173180 name : "successful get" ,
174181 fields : fields {
175182 verifier : newTrueVerifier (),
176- fetcher : NewFileFetcher (filepath .Join (testdataPath (), "test-with-directory.zip" )),
183+ fetcher : NewFileFetcher (filepath .Join (testdataPath (), "test-with-directory-entry .zip" )),
177184 },
178- uri : "foo/bar/test-with-directory.zip" ,
185+ uri : "foo/bar/test-with-directory-entry .zip" ,
179186 wantErr : false ,
180187 },
181188 {
@@ -184,7 +191,7 @@ func TestDownloader_Get(t *testing.T) {
184191 verifier : newTrueVerifier (),
185192 fetcher : errorFetcher {},
186193 },
187- uri : "foo/bar/test-with-directory.zip" ,
194+ uri : "foo/bar/test-with-directory-entry .zip" ,
188195 wantErr : true ,
189196 },
190197 }
@@ -201,7 +208,7 @@ func TestDownloader_Get(t *testing.T) {
201208}
202209
203210func Test_download (t * testing.T ) {
204- filePath := filepath .Join (testdataPath (), "test-with-directory.zip" )
211+ filePath := filepath .Join (testdataPath (), "test-with-directory-entry .zip" )
205212 downloadOriginal , err := ioutil .ReadFile (filePath )
206213 if err != nil {
207214 t .Fatal (err )
@@ -302,15 +309,15 @@ func Test_detectMIMEType(t *testing.T) {
302309 {
303310 name : "type zip" ,
304311 args : args {
305- file : filepath .Join (testdataPath (), "test-with-directory.zip" ),
312+ file : filepath .Join (testdataPath (), "test-with-directory-entry .zip" ),
306313 },
307314 want : "application/zip" ,
308315 wantErr : false ,
309316 },
310317 {
311318 name : "type tar.gz" ,
312319 args : args {
313- file : filepath .Join (testdataPath (), "test-with-nesting-with- directory-entries .tar.gz" ),
320+ file : filepath .Join (testdataPath (), "test-with-directory-entry .tar.gz" ),
314321 },
315322 want : "application/x-gzip" ,
316323 wantErr : false ,
@@ -434,7 +441,7 @@ func Test_extractArchive(t *testing.T) {
434441 args : args {
435442 filename : "" ,
436443 dst : "" ,
437- file : filepath .Join (testdataPath (), "test-with-nesting-with- directory-entries .tar.gz" ),
444+ file : filepath .Join (testdataPath (), "test-with-directory-entry .tar.gz" ),
438445 },
439446 wantErr : true ,
440447 },
0 commit comments