blob: d043a2aae50da0d9b9920626c2516f24dc861bc5 [file] [log] [blame]
Jon Perritt50da9b42014-09-14 15:06:59 -05001package containers
2
3import (
Jon Perritt50da9b42014-09-14 15:06:59 -05004 "github.com/rackspace/gophercloud"
Jon Perrittb3461402014-10-09 21:36:17 -05005 th "github.com/rackspace/gophercloud/testhelper"
6 "testing"
Jon Perritt50da9b42014-09-14 15:06:59 -05007)
8
Jon Perrittb3461402014-10-09 21:36:17 -05009const endpoint = "http://localhost:57909/"
Jon Perritt50da9b42014-09-14 15:06:59 -050010
Jon Perrittb3461402014-10-09 21:36:17 -050011func endpointClient() *gophercloud.ServiceClient {
12 return &gophercloud.ServiceClient{Endpoint: endpoint}
Jon Perritt50da9b42014-09-14 15:06:59 -050013}
14
Jon Perrittb3461402014-10-09 21:36:17 -050015func TestListURL(t *testing.T) {
16 actual := listURL(endpointClient())
17 expected := endpoint
18 th.CheckEquals(t, expected, actual)
19}
20
21func TestCreateURL(t *testing.T) {
22 actual := createURL(endpointClient(), "foo")
23 expected := endpoint + "foo"
24 th.CheckEquals(t, expected, actual)
25}
26
27func TestGetURL(t *testing.T) {
28 actual := getURL(endpointClient(), "foo")
29 expected := endpoint + "foo"
30 th.CheckEquals(t, expected, actual)
31}
32
33func TestDeleteURL(t *testing.T) {
34 actual := deleteURL(endpointClient(), "foo")
35 expected := endpoint + "foo"
36 th.CheckEquals(t, expected, actual)
37}
38
39func TestUpdateURL(t *testing.T) {
40 actual := updateURL(endpointClient(), "foo")
41 expected := endpoint + "foo"
42 th.CheckEquals(t, expected, actual)
Jon Perritt50da9b42014-09-14 15:06:59 -050043}