blob: 16b14cb0f25c8526d9a421ee1522b3cd848a7780 [file] [log] [blame]
Jon Perritte747a0f2014-09-29 19:54:55 -05001package volumes
Jon Perritt82522ca2014-09-29 22:31:31 -05002
3import (
4 "testing"
5
Jon Perritt27249f42016-02-18 10:35:59 -06006 "github.com/gophercloud/gophercloud"
7 th "github.com/gophercloud/gophercloud/testhelper"
Jon Perritt82522ca2014-09-29 22:31:31 -05008)
9
10const endpoint = "http://localhost:57909"
11
12func endpointClient() *gophercloud.ServiceClient {
13 return &gophercloud.ServiceClient{Endpoint: endpoint}
14}
15
Jon Perritt6d5561b2014-10-01 21:42:15 -050016func TestCreateURL(t *testing.T) {
17 actual := createURL(endpointClient())
Jon Perritt82522ca2014-09-29 22:31:31 -050018 expected := endpoint + "volumes"
19 th.AssertEquals(t, expected, actual)
20}
21
Jon Perritt6d5561b2014-10-01 21:42:15 -050022func 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")
Jon Perritt82522ca2014-09-29 22:31:31 -050042 expected := endpoint + "volumes/foo"
43 th.AssertEquals(t, expected, actual)
44}