blob: 5a31b32316cf1038bde9a82fd416b0e098d5c705 [file] [log] [blame]
Ash Wilsonb73b7f82014-08-29 15:38:06 -04001package services
2
3import (
4 "testing"
5
6 "github.com/rackspace/gophercloud"
7)
8
Ash Wilson3f59ade2014-10-02 09:22:23 -04009func TestListURL(t *testing.T) {
Ash Wilsonb73b7f82014-08-29 15:38:06 -040010 client := gophercloud.ServiceClient{Endpoint: "http://localhost:5000/v3/"}
Ash Wilson3f59ade2014-10-02 09:22:23 -040011 url := listURL(&client)
Ash Wilsonb73b7f82014-08-29 15:38:06 -040012 if url != "http://localhost:5000/v3/services" {
13 t.Errorf("Unexpected list URL generated: [%s]", url)
14 }
15}
Ash Wilson6e870032014-09-02 08:38:27 -040016
Ash Wilson3f59ade2014-10-02 09:22:23 -040017func TestServiceURL(t *testing.T) {
Ash Wilson6e870032014-09-02 08:38:27 -040018 client := gophercloud.ServiceClient{Endpoint: "http://localhost:5000/v3/"}
Ash Wilson3f59ade2014-10-02 09:22:23 -040019 url := serviceURL(&client, "1234")
Ash Wilson6e870032014-09-02 08:38:27 -040020 if url != "http://localhost:5000/v3/services/1234" {
21 t.Errorf("Unexpected service URL generated: [%s]", url)
22 }
23}