blob: 774e2e7eb489eb5f8cf48538ec95cc1e424125ba [file] [log] [blame]
Brad Isonbaade942016-04-07 21:40:38 -04001package policies
2
3import (
4 "testing"
5
6 "github.com/rackspace/gophercloud"
7 th "github.com/rackspace/gophercloud/testhelper"
8)
9
10const endpoint = "http://localhost:57909/"
11
12func endpointClient() *gophercloud.ServiceClient {
13 return &gophercloud.ServiceClient{Endpoint: endpoint}
14}
15
16func TestListURL(t *testing.T) {
17 actual := listURL(endpointClient(), "123")
18 expected := endpoint + "groups/123/policies"
19 th.CheckEquals(t, expected, actual)
20}
21
22func TestCreateURL(t *testing.T) {
23 actual := createURL(endpointClient(), "123")
24 expected := endpoint + "groups/123/policies"
25 th.CheckEquals(t, expected, actual)
26}
27
28func 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
34func 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
40func 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
46func 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}