Files
aquasecurity-trivy/cache/cache_test.go

21 lines
383 B
Go
Raw Normal View History

package cache
import (
"io/ioutil"
"os"
2019-12-25 13:57:07 +02:00
"path/filepath"
"testing"
"github.com/stretchr/testify/assert"
)
func TestRealCache_Clear(t *testing.T) {
d, _ := ioutil.TempDir("", "TestRealCache_Clear")
2019-12-25 13:57:07 +02:00
defer os.RemoveAll(d)
c, err := New(d)
assert.NoError(t, err)
assert.NoError(t, c.Clear())
2019-12-25 13:57:07 +02:00
_, err = os.Stat(filepath.Join(d, "fanal"))
assert.True(t, os.IsNotExist(err))
}