cli/pkg/cmd/attestation/verification/tuf_test.go
Meredith Lancaster 49dfa3f6d5 use CLI cache dir to store tuf metadata
Signed-off-by: Meredith Lancaster <malancas@github.com>
2024-03-20 15:18:19 -06:00

20 lines
471 B
Go

package verification
import (
"os"
"path/filepath"
"testing"
"github.com/cli/go-gh/v2/pkg/config"
"github.com/stretchr/testify/require"
)
func TestGitHubTUFOptions(t *testing.T) {
os.Setenv("CODESPACES", "true")
opts := GitHubTUFOptions()
require.Equal(t, GitHubTUFMirror, opts.RepositoryBaseURL)
require.NotNil(t, opts.Root)
require.True(t, opts.DisableLocalCache)
require.Equal(t, filepath.Join(config.CacheDir(), ".sigstore", "root"), opts.CachePath)
}