2016-07-28 09:24:41 +02:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"bytes"
|
|
|
|
"testing"
|
2019-02-15 10:41:35 +01:00
|
|
|
|
|
|
|
"github.com/stretchr/testify/assert"
|
2016-07-28 09:24:41 +02:00
|
|
|
)
|
|
|
|
|
|
|
|
func TestExtractFromZip(t *testing.T) {
|
|
|
|
buf := bytes.NewBuffer(nil)
|
2016-07-30 03:31:00 +02:00
|
|
|
err := ExtractFromZip("testdata/test.zip", "**/foo.txt", buf)
|
2019-02-15 10:41:35 +01:00
|
|
|
assert.Nil(t, err)
|
2016-07-28 09:24:41 +02:00
|
|
|
t.Log("Content: " + buf.String())
|
|
|
|
}
|
2019-02-15 10:28:46 +01:00
|
|
|
|
|
|
|
//func TestUnzipTo(t *testing.T){
|
|
|
|
// err := unzipFile("testdata.zip", "./tmp")
|
|
|
|
// assert.Nil(t, err)
|
2019-02-15 10:41:35 +01:00
|
|
|
//}
|