mirror of
https://github.com/woodchen-ink/webp_server_go.git
synced 2025-07-18 13:42:02 +08:00
* Try using vips * No need libaom * Update code and version * update * Fix CI * Add sudo * Fix CI * Make CI happy * we happy few * Update README, fix CI * Add --no-install-recommends * Update code * Add ca-certificates for proxymode * Add pics/invalid.png for testing * Update README --------- Co-authored-by: Benny <benny.think@gmail.com>
23 lines
395 B
Go
23 lines
395 B
Go
package main
|
|
|
|
import (
|
|
"os"
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
)
|
|
|
|
func TestPrefetchImages(t *testing.T) {
|
|
fp := "./prefetch"
|
|
_ = os.Mkdir(fp, 0755)
|
|
prefetchImages("./pics/dir1/", "./prefetch")
|
|
count := fileCount("./prefetch")
|
|
assert.Equal(t, int64(1), count)
|
|
_ = os.RemoveAll(fp)
|
|
}
|
|
|
|
func TestBadPrefetch(t *testing.T) {
|
|
jobs = 1
|
|
prefetchImages("./pics2", "./prefetch")
|
|
}
|