Skip to content

Commit

Permalink
Resolve last batch of failing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
fergusstrange committed Oct 10, 2021
1 parent c3f9f76 commit fc52fea
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion remote_fetch.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ func decompressResponse(resp *http.Response, cacheLocator CacheLocator, download
}

for _, file := range zipReader.File {
if strings.HasSuffix(file.FileHeader.Name, ".txz") {
if !file.FileHeader.FileInfo().IsDir() && strings.HasSuffix(file.FileHeader.Name, ".txz") {
archiveReader, err := file.Open()
if err != nil {
return errorExtractingPostgres(err)
Expand Down
6 changes: 3 additions & 3 deletions remote_fetch_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ func Test_defaultRemoteFetchStrategy_ErrorWhenCannotExtractSubArchive(t *testing

err := remoteFetchStrategy()

assert.EqualError(t, err, "unable to extract postgres archive to "+dirBlockingExtract)
assert.Regexp(t, "^unable to extract postgres archive:.+$", err)
}

func Test_defaultRemoteFetchStrategy_ErrorWhenCannotCreateCacheDirectory(t *testing.T) {
Expand Down Expand Up @@ -167,7 +167,7 @@ func Test_defaultRemoteFetchStrategy_ErrorWhenCannotCreateCacheDirectory(t *test

err := remoteFetchStrategy()

assert.EqualError(t, err, "unable to extract postgres archive to "+cacheLocation)
assert.Regexp(t, "^unable to extract postgres archive:.+$", err)
}

func Test_defaultRemoteFetchStrategy_ErrorWhenCannotCreateSubArchiveFile(t *testing.T) {
Expand Down Expand Up @@ -199,7 +199,7 @@ func Test_defaultRemoteFetchStrategy_ErrorWhenCannotCreateSubArchiveFile(t *test

err := remoteFetchStrategy()

assert.EqualError(t, err, "unable to extract postgres archive to "+cacheLocation)
assert.Regexp(t, "^unable to extract postgres archive:.+$", err)
}

func Test_defaultRemoteFetchStrategy(t *testing.T) {
Expand Down

0 comments on commit fc52fea

Please sign in to comment.