blob: 983992e2b9b27b1b889f20db83b9bb838f467088 [file] [log] [blame]
Jon Perritt24270c42014-10-21 21:11:04 -05001package networks
2
3import (
Jon Perritt44b1ea22014-10-22 00:13:23 -05004 "testing"
Jon Perritt24270c42014-10-21 21:11:04 -05005
Jon Perritt44b1ea22014-10-22 00:13:23 -05006 "github.com/rackspace/gophercloud"
7 th "github.com/rackspace/gophercloud/testhelper"
Jon Perritt24270c42014-10-21 21:11:04 -05008)
9
Jon Perritt44b1ea22014-10-22 00:13:23 -050010const endpoint = "http://localhost:57909/"
Jon Perritt24270c42014-10-21 21:11:04 -050011
12func endpointClient() *gophercloud.ServiceClient {
Jon Perritt44b1ea22014-10-22 00:13:23 -050013 return &gophercloud.ServiceClient{Endpoint: endpoint}
Jon Perritt24270c42014-10-21 21:11:04 -050014}
15
16func TestGetURL(t *testing.T) {
Jon Perritt44b1ea22014-10-22 00:13:23 -050017 actual := getURL(endpointClient(), "foo")
18 expected := endpoint + "os-networksv2/foo"
19 th.AssertEquals(t, expected, actual)
Jon Perritt24270c42014-10-21 21:11:04 -050020}
21
22func TestCreateURL(t *testing.T) {
Jon Perritt44b1ea22014-10-22 00:13:23 -050023 actual := createURL(endpointClient())
24 expected := endpoint + "os-networksv2"
25 th.AssertEquals(t, expected, actual)
Jon Perritt24270c42014-10-21 21:11:04 -050026}
27
28func TestListURL(t *testing.T) {
Jon Perritt44b1ea22014-10-22 00:13:23 -050029 actual := createURL(endpointClient())
30 expected := endpoint + "os-networksv2"
31 th.AssertEquals(t, expected, actual)
Jon Perritt24270c42014-10-21 21:11:04 -050032}
33
34func TestDeleteURL(t *testing.T) {
Jon Perritt44b1ea22014-10-22 00:13:23 -050035 actual := deleteURL(endpointClient(), "foo")
36 expected := endpoint + "os-networksv2/foo"
37 th.AssertEquals(t, expected, actual)
Jon Perritt24270c42014-10-21 21:11:04 -050038}