openstack/rackspace stack resources template op/unit test
diff --git a/rackspace/orchestration/v1/stackresources/delegate.go b/rackspace/orchestration/v1/stackresources/delegate.go
index 9029a24..cb7be28 100644
--- a/rackspace/orchestration/v1/stackresources/delegate.go
+++ b/rackspace/orchestration/v1/stackresources/delegate.go
@@ -35,3 +35,8 @@
func Schema(c *gophercloud.ServiceClient, resourceType string) os.SchemaResult {
return os.Schema(c, resourceType)
}
+
+// Template retreives the template representation for the given resource type.
+func Template(c *gophercloud.ServiceClient, resourceType string) os.TemplateResult {
+ return os.Template(c, resourceType)
+}
diff --git a/rackspace/orchestration/v1/stackresources/delegate_test.go b/rackspace/orchestration/v1/stackresources/delegate_test.go
index 5800d7c..18e9614 100644
--- a/rackspace/orchestration/v1/stackresources/delegate_test.go
+++ b/rackspace/orchestration/v1/stackresources/delegate_test.go
@@ -94,3 +94,15 @@
expected := os.GetSchemaExpected
th.AssertDeepEquals(t, expected, actual)
}
+
+func TestGetResourceTemplate(t *testing.T) {
+ th.SetupHTTP()
+ defer th.TeardownHTTP()
+ os.HandleGetTemplateSuccessfully(t, os.GetTemplateOutput)
+
+ actual, err := Template(fake.ServiceClient(), "OS::Heat::AResourceName").Extract()
+ th.AssertNoErr(t, err)
+
+ expected := os.GetTemplateExpected
+ th.AssertDeepEquals(t, expected, actual)
+}