blob: 7d2b94ffed5d7e96c774d4a9e559b5ab903ffa1b [file] [log] [blame]
Ash Wilson0a997f82014-09-03 15:50:52 -04001package endpoints
2
3import (
4 "testing"
5
Jon Perritt27249f42016-02-18 10:35:59 -06006 "github.com/gophercloud/gophercloud"
Ash Wilson0a997f82014-09-03 15:50:52 -04007)
8
9func TestGetListURL(t *testing.T) {
10 client := gophercloud.ServiceClient{Endpoint: "http://localhost:5000/v3/"}
Ash Wilson1e1b7332014-09-30 16:38:11 -040011 url := listURL(&client)
Ash Wilson0a997f82014-09-03 15:50:52 -040012 if url != "http://localhost:5000/v3/endpoints" {
13 t.Errorf("Unexpected list URL generated: [%s]", url)
14 }
15}
16
17func TestGetEndpointURL(t *testing.T) {
18 client := gophercloud.ServiceClient{Endpoint: "http://localhost:5000/v3/"}
Ash Wilson1e1b7332014-09-30 16:38:11 -040019 url := endpointURL(&client, "1234")
Ash Wilson0a997f82014-09-03 15:50:52 -040020 if url != "http://localhost:5000/v3/endpoints/1234" {
21 t.Errorf("Unexpected service URL generated: [%s]", url)
22 }
23}