Skip to content
This repository was archived by the owner on Aug 1, 2023. It is now read-only.

Commit baade94

Browse files
committed
Rackspace Auto Scale: Add policies URL tests
1 parent 42f8dfb commit baade94

File tree

1 file changed

+50
-0
lines changed

1 file changed

+50
-0
lines changed
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
package policies
2+
3+
import (
4+
"testing"
5+
6+
"github.com/rackspace/gophercloud"
7+
th "github.com/rackspace/gophercloud/testhelper"
8+
)
9+
10+
const endpoint = "http://localhost:57909/"
11+
12+
func endpointClient() *gophercloud.ServiceClient {
13+
return &gophercloud.ServiceClient{Endpoint: endpoint}
14+
}
15+
16+
func TestListURL(t *testing.T) {
17+
actual := listURL(endpointClient(), "123")
18+
expected := endpoint + "groups/123/policies"
19+
th.CheckEquals(t, expected, actual)
20+
}
21+
22+
func TestCreateURL(t *testing.T) {
23+
actual := createURL(endpointClient(), "123")
24+
expected := endpoint + "groups/123/policies"
25+
th.CheckEquals(t, expected, actual)
26+
}
27+
28+
func TestGetURL(t *testing.T) {
29+
actual := getURL(endpointClient(), "123", "456")
30+
expected := endpoint + "groups/123/policies/456"
31+
th.CheckEquals(t, expected, actual)
32+
}
33+
34+
func TestUpdateURL(t *testing.T) {
35+
actual := updateURL(endpointClient(), "123", "456")
36+
expected := endpoint + "groups/123/policies/456"
37+
th.CheckEquals(t, expected, actual)
38+
}
39+
40+
func TestDeleteURL(t *testing.T) {
41+
actual := deleteURL(endpointClient(), "123", "456")
42+
expected := endpoint + "groups/123/policies/456"
43+
th.CheckEquals(t, expected, actual)
44+
}
45+
46+
func TestExecuteURL(t *testing.T) {
47+
actual := executeURL(endpointClient(), "123", "456")
48+
expected := endpoint + "groups/123/policies/456/execute"
49+
th.CheckEquals(t, expected, actual)
50+
}

0 commit comments

Comments
 (0)