"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "internal/getproviders/registry_client_test.go" between
terraform-1.0.2.tar.gz and terraform-1.0.3.tar.gz

About: Terraform is a tool for building, changing, and versioning a datacenter infrastructure (written in Go).

registry_client_test.go  (terraform-1.0.2):registry_client_test.go  (terraform-1.0.3)
skipping to change at line 221 skipping to change at line 221
resp.Header().Set("Content-Type", "application/json") resp.Header().Set("Content-Type", "application/json")
resp.WriteHeader(200) resp.WriteHeader(200)
// Note that these version numbers are intentionally miso rdered // Note that these version numbers are intentionally miso rdered
// so we can test that the client-side code places them i n the // so we can test that the client-side code places them i n the
// correct order (lowest precedence first). // correct order (lowest precedence first).
resp.Write([]byte(`{"versions":[{"version":"0.1.0","proto cols":["1.0"]},{"version":"2.0.0","protocols":["99.0"]},{"version":"1.2.0","prot ocols":["5.0"]}, {"version":"1.0.0","protocols":["5.0"]}]}`)) resp.Write([]byte(`{"versions":[{"version":"0.1.0","proto cols":["1.0"]},{"version":"2.0.0","protocols":["99.0"]},{"version":"1.2.0","prot ocols":["5.0"]}, {"version":"1.0.0","protocols":["5.0"]}]}`))
case "weaksauce/unsupported-protocol": case "weaksauce/unsupported-protocol":
resp.Header().Set("Content-Type", "application/json") resp.Header().Set("Content-Type", "application/json")
resp.WriteHeader(200) resp.WriteHeader(200)
resp.Write([]byte(`{"versions":[{"version":"1.0.0","proto cols":["0.1"]}]}`)) resp.Write([]byte(`{"versions":[{"version":"1.0.0","proto cols":["0.1"]}]}`))
case "weaksauce/protocol-six":
resp.Header().Set("Content-Type", "application/json")
resp.WriteHeader(200)
resp.Write([]byte(`{"versions":[{"version":"1.0.0","proto
cols":["6.0"]}]}`))
case "weaksauce/no-versions": case "weaksauce/no-versions":
resp.Header().Set("Content-Type", "application/json") resp.Header().Set("Content-Type", "application/json")
resp.WriteHeader(200) resp.WriteHeader(200)
resp.Write([]byte(`{"versions":[],"warnings":["this provi der is weaksauce"]}`)) resp.Write([]byte(`{"versions":[],"warnings":["this provi der is weaksauce"]}`))
case "-/legacy": case "-/legacy":
resp.Header().Set("Content-Type", "application/json") resp.Header().Set("Content-Type", "application/json")
resp.WriteHeader(200) resp.WriteHeader(200)
// This response is used for testing LookupLegacyProvider // This response is used for testing LookupLegacyProvider
resp.Write([]byte(`{"id":"legacycorp/legacy"}`)) resp.Write([]byte(`{"id":"legacycorp/legacy"}`))
case "-/moved": case "-/moved":
skipping to change at line 415 skipping to change at line 419
MustParseVersion("1.2.0"), MustParseVersion("1.2.0"),
versions.Unspecified, versions.Unspecified,
``, ``,
}, },
"unsupported provider protocol": { "unsupported provider protocol": {
addrs.MustParseProviderSourceString("example.com/weaksauc e/unsupported-protocol"), addrs.MustParseProviderSourceString("example.com/weaksauc e/unsupported-protocol"),
MustParseVersion("1.0.0"), MustParseVersion("1.0.0"),
versions.Unspecified, versions.Unspecified,
``, ``,
}, },
"provider protocol six": {
addrs.MustParseProviderSourceString("example.com/weaksauc
e/protocol-six"),
MustParseVersion("1.0.0"),
MustParseVersion("1.0.0"),
``,
},
} }
for name, test := range tests { for name, test := range tests {
t.Run(name, func(t *testing.T) { t.Run(name, func(t *testing.T) {
client, err := source.registryClient(test.provider.Hostna me) client, err := source.registryClient(test.provider.Hostna me)
if err != nil { if err != nil {
t.Fatal(err) t.Fatal(err)
} }
got, err := client.findClosestProtocolCompatibleVersion(c ontext.Background(), test.provider, test.version) got, err := client.findClosestProtocolCompatibleVersion(c ontext.Background(), test.provider, test.version)
 End of changes. 2 change blocks. 
0 lines changed or deleted 12 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)