Bring partially https://github.com/gophercloud/gophercloud/pull/1221
Change-Id: I185e1991b68a22b387d043bc32bef79cd4c3dc4e
Related-To: PRODX-8893
diff --git a/openstack/orchestration/v1/stacks/environment_test.go b/openstack/orchestration/v1/stacks/environment_test.go
index e7fe61d..e0c29c1 100644
--- a/openstack/orchestration/v1/stacks/environment_test.go
+++ b/openstack/orchestration/v1/stacks/environment_test.go
@@ -138,7 +138,7 @@
// handler for my_env.yaml
th.Mux.HandleFunc(urlparsed.Path, func(w http.ResponseWriter, r *http.Request) {
th.TestMethod(t, r, "GET")
- w.Header().Set("Content-Type", "application/jason")
+ w.Header().Set("Content-Type", "application/json")
w.WriteHeader(http.StatusOK)
fmt.Fprintf(w, environmentContent)
})
@@ -150,7 +150,7 @@
// handler for my_db.yaml
th.Mux.HandleFunc(urlparsed.Path, func(w http.ResponseWriter, r *http.Request) {
th.TestMethod(t, r, "GET")
- w.Header().Set("Content-Type", "application/jason")
+ w.Header().Set("Content-Type", "application/json")
w.WriteHeader(http.StatusOK)
fmt.Fprintf(w, dbContent)
})
@@ -170,13 +170,20 @@
th.AssertEquals(t, expectedEnvFilesContent, env.Files[fakeEnvURL])
th.AssertEquals(t, expectedDBFilesContent, env.Files[fakeDBURL])
+ // Update env's fileMaps to replace relative filenames by absolute URLs.
+ env.fileMaps = map[string]string{
+ "my_env.yaml": fakeEnvURL,
+ "my_db.yaml": fakeDBURL,
+ }
env.fixFileRefs()
+
expectedParsed := map[string]interface{}{
- "resource_registry": "2015-04-30",
- "My::WP::Server": fakeEnvURL,
- "resources": map[string]interface{}{
- "my_db_server": map[string]interface{}{
- "OS::DBInstance": fakeDBURL,
+ "resource_registry": map[string]interface{}{
+ "My::WP::Server": fakeEnvURL,
+ "resources": map[string]interface{}{
+ "my_db_server": map[string]interface{}{
+ "OS::DBInstance": fakeDBURL,
+ },
},
},
}