cli/command/image: use t.SetEnv in trust tests
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
@ -5,11 +5,10 @@ import (
|
||||
|
||||
"github.com/docker/cli/cli/trust"
|
||||
registrytypes "github.com/docker/docker/api/types/registry"
|
||||
"gotest.tools/v3/env"
|
||||
)
|
||||
|
||||
func TestENVTrustServer(t *testing.T) {
|
||||
env.PatchAll(t, map[string]string{"DOCKER_CONTENT_TRUST_SERVER": "https://notary-test.example.com:5000"})
|
||||
t.Setenv("DOCKER_CONTENT_TRUST_SERVER", "https://notary-test.example.com:5000")
|
||||
indexInfo := ®istrytypes.IndexInfo{Name: "testserver"}
|
||||
output, err := trust.Server(indexInfo)
|
||||
expectedStr := "https://notary-test.example.com:5000"
|
||||
@ -19,7 +18,7 @@ func TestENVTrustServer(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestHTTPENVTrustServer(t *testing.T) {
|
||||
env.PatchAll(t, map[string]string{"DOCKER_CONTENT_TRUST_SERVER": "http://notary-test.example.com:5000"})
|
||||
t.Setenv("DOCKER_CONTENT_TRUST_SERVER", "http://notary-test.example.com:5000")
|
||||
indexInfo := ®istrytypes.IndexInfo{Name: "testserver"}
|
||||
_, err := trust.Server(indexInfo)
|
||||
if err == nil {
|
||||
|
||||
Reference in New Issue
Block a user