Repository: helm/helm
File: pkg/cmd/pull_test.go (Go)

Code before:
		{
			name:       "OCI Chart fetch with credentials and untar",
			args:       buildOCIURL(ociSrv.RegistryURL, "oci-dependent-chart", "0.1.0", ociSrv.TestUsername, ociSrv.TestPassword) + " --untar",
			expectFile: "./oci-dependent-chart",
			expectDir:  true,
		},
		{
			name:       "OCI Chart fetch with credentials and untardir",
			args:       buildOCIURL(ociSrv.RegistryURL, "oci-dependent-chart", "0.1.0", ociSrv.TestUsername, ociSrv.TestPassword) + " --untar --untardir ocitest-credentials",
			expectFile: "./ocitest-credentials",
			expectDir:  true,
		},
		{
			name:      "Fail fetching OCI chart with wrong credentials",
			args:      buildOCIURL(ociSrv.RegistryURL, "oci-dependent-chart", "0.1.0", "wronguser", "wrongpass"),
			wantError: true,
		},
		{
			name:      "Fail fetching non-existent OCI chart with credentials",
			args:      buildOCIURL(ociSrv.RegistryURL, "nosuchthing", "0.1.0", ociSrv.TestUsername, ociSrv.TestPassword),
			wantError: true,
		},
		{
			name:         "Fail fetching OCI chart without version specified",
			args:         buildOCIURL(ociSrv.RegistryURL, "nosuchthing", "", ociSrv.TestUsername, ociSrv.TestPassword),
			wantErrorMsg: "Error: --version flag is explicitly required for OCI registries",
			wantError:    true,
		},
	}

	runPullTests(t, tests, srv.Root(), "--plain-http")
}

func TestPullFileCompletion(t *testing.T) {
	checkFileCompletion(t, "pull", false)
	checkFileCompletion(t, "pull repo/chart", false)
}


Review comment (suggestion):
Removed because it is
```go
wantErrorMsg: fmt.Sprintf("GET \"http://%s/v2/u/ocitestuser/nosuchthing/tags/list\": response status code 404: name unknown: repository name not known to registry: map[name:u/ocitestuser/nosuchthing]", ociSrv.RegistryURL),
```

Code after:
	}{
		{
			name:       "OCI Chart fetch with credentials",
			args:       buildOCIURL(ociSrv.RegistryURL, "oci-dependent-chart", "0.1.0", ociSrv.TestUsername, ociSrv.TestPassword),
			expectFile: "./oci-dependent-chart-0.1.0.tgz",
		},
		{
			name:       "OCI Chart fetch with credentials and untar",
			args:       buildOCIURL(ociSrv.RegistryURL, "oci-dependent-chart", "0.1.0", ociSrv.TestUsername, ociSrv.TestPassword) + " --untar",
			expectFile: "./oci-dependent-chart",
			expectDir:  true,
		},
		{
			name:       "OCI Chart fetch with credentials and untardir",
			args:       buildOCIURL(ociSrv.RegistryURL, "oci-dependent-chart", "0.1.0", ociSrv.TestUsername, ociSrv.TestPassword) + " --untar --untardir ocitest-credentials",
			expectFile: "./ocitest-credentials",
			expectDir:  true,
		},
		{
			name:      "Fail fetching OCI chart with wrong credentials",
			args:      buildOCIURL(ociSrv.RegistryURL, "oci-dependent-chart", "0.1.0", "wronguser", "wrongpass"),
			wantError: true,
		},
		{
			name:      "Fail fetching non-existent OCI chart with credentials",
			args:      buildOCIURL(ociSrv.RegistryURL, "nosuchthing", "0.1.0", ociSrv.TestUsername, ociSrv.TestPassword),
			wantError: true,
		},
		{
			name:      "Fail fetching OCI chart without version specified",
			args:      buildOCIURL(ociSrv.RegistryURL, "nosuchthing", "", ociSrv.TestUsername, ociSrv.TestPassword),
			wantError: true,
		},
	}

	runPullTests(t, tests, srv.Root(), "--plain-http")
}

func TestPullFileCompletion(t *testing.T) {
	checkFileCompletion(t, "pull", false)
	checkFileCompletion(t, "pull repo/chart", false)
}