blob: 1dcfe3543c790d9d20ce757c23b6114dea610c80 [file] [log] [blame]
Jon Perrittf81e17a2014-09-15 01:29:41 -05001package objects
2
3import (
4 "testing"
Jon Perrittea4e3012014-10-09 22:03:19 -05005
Jon Perrittf81e17a2014-09-15 01:29:41 -05006 "github.com/rackspace/gophercloud"
Jon Perrittea4e3012014-10-09 22:03:19 -05007 th "github.com/rackspace/gophercloud/testhelper"
Jon Perrittf81e17a2014-09-15 01:29:41 -05008)
9
Jon Perrittea4e3012014-10-09 22:03:19 -050010const endpoint = "http://localhost:57909/"
11
12func endpointClient() *gophercloud.ServiceClient {
13 return &gophercloud.ServiceClient{Endpoint: endpoint}
Jon Perrittf81e17a2014-09-15 01:29:41 -050014}
15
Jon Perrittea4e3012014-10-09 22:03:19 -050016func TestListURL(t *testing.T) {
17 actual := listURL(endpointClient(), "foo")
18 expected := endpoint + "foo"
19 th.CheckEquals(t, expected, actual)
20}
21
22func TestCopyURL(t *testing.T) {
23 actual := copyURL(endpointClient(), "foo", "bar")
24 expected := endpoint + "foo/bar"
25 th.CheckEquals(t, expected, actual)
26}
27
28func TestCreateURL(t *testing.T) {
29 actual := createURL(endpointClient(), "foo", "bar")
30 expected := endpoint + "foo/bar"
31 th.CheckEquals(t, expected, actual)
32}
33
34func TestGetURL(t *testing.T) {
35 actual := getURL(endpointClient(), "foo", "bar")
36 expected := endpoint + "foo/bar"
37 th.CheckEquals(t, expected, actual)
38}
39
40func TestDeleteURL(t *testing.T) {
41 actual := deleteURL(endpointClient(), "foo", "bar")
42 expected := endpoint + "foo/bar"
43 th.CheckEquals(t, expected, actual)
44}
45
46func TestDownloadURL(t *testing.T) {
47 actual := downloadURL(endpointClient(), "foo", "bar")
48 expected := endpoint + "foo/bar"
49 th.CheckEquals(t, expected, actual)
50}
51
52func TestUpdateURL(t *testing.T) {
53 actual := updateURL(endpointClient(), "foo", "bar")
54 expected := endpoint + "foo/bar"
55 th.CheckEquals(t, expected, actual)
Jon Perrittf81e17a2014-09-15 01:29:41 -050056}