Files
pmg/cmd/setup/cache_test.go
T
Abhisek DattaandGitHub d360e75897 feat: Add malysis cache implementation with proxy flow integration (#346)
* feat: Add malysis cache implementation with proxy flow integration

* fix: Code review fixes
2026-06-22 10:12:02 +05:30

26 lines
563 B
Go

package setup
import (
"bytes"
"context"
"testing"
"github.com/safedep/pmg/config"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
func TestRunCache_NoFile(t *testing.T) {
t.Setenv("PMG_CACHE_DIR", t.TempDir())
config.Reload()
cfg := config.Get()
var out bytes.Buffer
require.NoError(t, runCacheStatus(context.Background(), cfg, &out))
assert.Contains(t, out.String(), "Entries: 0")
out.Reset()
require.NoError(t, runCacheClear(context.Background(), cfg, &out))
assert.Contains(t, out.String(), "already empty")
}