github.1git.de/docker/cli@v26.1.3+incompatible/cli/command/trust/helpers_test.go (about) 1 package trust 2 3 import ( 4 "testing" 5 6 "github.com/theupdateframework/notary/client" 7 "github.com/theupdateframework/notary/passphrase" 8 "github.com/theupdateframework/notary/trustpinning" 9 "gotest.tools/v3/assert" 10 ) 11 12 func TestGetOrGenerateNotaryKeyAndInitRepo(t *testing.T) { 13 notaryRepo, err := client.NewFileCachedRepository(t.TempDir(), "gun", "https://localhost", nil, passphrase.ConstantRetriever(passwd), trustpinning.TrustPinConfig{}) 14 assert.NilError(t, err) 15 16 err = getOrGenerateRootKeyAndInitRepo(notaryRepo) 17 assert.Error(t, err, "client is offline") 18 }