2018-06-30 14:29:22 +02:00
|
|
|
package croc
|
|
|
|
|
|
|
|
import (
|
2018-06-30 18:01:30 +02:00
|
|
|
"os"
|
2018-06-30 14:29:22 +02:00
|
|
|
"testing"
|
|
|
|
|
|
|
|
log "github.com/cihub/seelog"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
|
|
)
|
|
|
|
|
|
|
|
func TestZip(t *testing.T) {
|
|
|
|
defer log.Flush()
|
|
|
|
writtenFilename, err := zipFile("../testing_data", false)
|
|
|
|
assert.Nil(t, err)
|
2018-06-30 18:01:30 +02:00
|
|
|
defer os.Remove(writtenFilename)
|
2018-06-30 14:29:22 +02:00
|
|
|
|
|
|
|
err = unzipFile(writtenFilename, ".")
|
|
|
|
assert.Nil(t, err)
|
|
|
|
assert.True(t, exists("testing_data"))
|
2018-06-30 18:01:30 +02:00
|
|
|
os.RemoveAll("testing_data")
|
2018-06-30 14:29:22 +02:00
|
|
|
}
|