blob: a95270e14cb4d22e57967657200a5890e840fa59 [file] [log] [blame]
feiskyda546142015-09-17 12:28:23 +08001package volumes
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 TestCreateURL(t *testing.T) {
17 actual := createURL(endpointClient())
18 expected := endpoint + "volumes"
19 th.AssertEquals(t, expected, actual)
20}
21
22func TestListURL(t *testing.T) {
23 actual := listURL(endpointClient())
24 expected := endpoint + "volumes"
25 th.AssertEquals(t, expected, actual)
26}
27
28func TestDeleteURL(t *testing.T) {
29 actual := deleteURL(endpointClient(), "foo")
30 expected := endpoint + "volumes/foo"
31 th.AssertEquals(t, expected, actual)
32}
33
34func TestGetURL(t *testing.T) {
35 actual := getURL(endpointClient(), "foo")
36 expected := endpoint + "volumes/foo"
37 th.AssertEquals(t, expected, actual)
38}
39
40func TestUpdateURL(t *testing.T) {
41 actual := updateURL(endpointClient(), "foo")
42 expected := endpoint + "volumes/foo"
43 th.AssertEquals(t, expected, actual)
44}