@@ -46,16 +46,23 @@ func Test_extractZIP(t *testing.T) {
46
46
files []string
47
47
}{
48
48
{
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" ,
50
56
files : []string {
51
57
"/test/" ,
52
58
"/test/foo" ,
53
59
},
54
60
},
55
61
{
56
- in : "test-without- directory.zip" ,
62
+ in : "test-with-no- directory-entry .zip" ,
57
63
files : []string {
58
- "/foo" ,
64
+ "/test/" ,
65
+ "/test/foo" ,
59
66
},
60
67
},
61
68
}
@@ -88,18 +95,18 @@ func Test_extractTARGZ(t *testing.T) {
88
95
files []string
89
96
}{
90
97
{
91
- in : "test-without-directory .tar.gz" ,
98
+ in : "test-flat-hierarchy .tar.gz" ,
92
99
files : []string {"/foo" },
93
100
},
94
101
{
95
- in : "test-with-nesting-with- directory-entries .tar.gz" ,
102
+ in : "test-with-directory-entry .tar.gz" ,
96
103
files : []string {
97
104
"/test/" ,
98
105
"/test/foo" ,
99
106
},
100
107
},
101
108
{
102
- in : "test-with-nesting-without- directory-entries .tar.gz" ,
109
+ in : "test-with-no- directory-entry .tar.gz" ,
103
110
files : []string {
104
111
"/test/" ,
105
112
"/test/foo" ,
@@ -173,9 +180,9 @@ func TestDownloader_Get(t *testing.T) {
173
180
name : "successful get" ,
174
181
fields : fields {
175
182
verifier : newTrueVerifier (),
176
- fetcher : NewFileFetcher (filepath .Join (testdataPath (), "test-with-directory.zip" )),
183
+ fetcher : NewFileFetcher (filepath .Join (testdataPath (), "test-with-directory-entry .zip" )),
177
184
},
178
- uri : "foo/bar/test-with-directory.zip" ,
185
+ uri : "foo/bar/test-with-directory-entry .zip" ,
179
186
wantErr : false ,
180
187
},
181
188
{
@@ -184,7 +191,7 @@ func TestDownloader_Get(t *testing.T) {
184
191
verifier : newTrueVerifier (),
185
192
fetcher : errorFetcher {},
186
193
},
187
- uri : "foo/bar/test-with-directory.zip" ,
194
+ uri : "foo/bar/test-with-directory-entry .zip" ,
188
195
wantErr : true ,
189
196
},
190
197
}
@@ -201,7 +208,7 @@ func TestDownloader_Get(t *testing.T) {
201
208
}
202
209
203
210
func Test_download (t * testing.T ) {
204
- filePath := filepath .Join (testdataPath (), "test-with-directory.zip" )
211
+ filePath := filepath .Join (testdataPath (), "test-with-directory-entry .zip" )
205
212
downloadOriginal , err := ioutil .ReadFile (filePath )
206
213
if err != nil {
207
214
t .Fatal (err )
@@ -302,15 +309,15 @@ func Test_detectMIMEType(t *testing.T) {
302
309
{
303
310
name : "type zip" ,
304
311
args : args {
305
- file : filepath .Join (testdataPath (), "test-with-directory.zip" ),
312
+ file : filepath .Join (testdataPath (), "test-with-directory-entry .zip" ),
306
313
},
307
314
want : "application/zip" ,
308
315
wantErr : false ,
309
316
},
310
317
{
311
318
name : "type tar.gz" ,
312
319
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" ),
314
321
},
315
322
want : "application/x-gzip" ,
316
323
wantErr : false ,
@@ -434,7 +441,7 @@ func Test_extractArchive(t *testing.T) {
434
441
args : args {
435
442
filename : "" ,
436
443
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" ),
438
445
},
439
446
wantErr : true ,
440
447
},
0 commit comments