blob: 89d1cb1d81b5648426cf544b7b84bbefdb1421c5 [file] [log] [blame]
Jon Perrittf81e17a2014-09-15 01:29:41 -05001package objects
2
3import (
4 "testing"
5 "github.com/rackspace/gophercloud"
6)
7
8func TestContainerURL(t *testing.T) {
9 client := gophercloud.ServiceClient{
10 Endpoint: "http://localhost:5000/v1/",
11 }
12 expected := "http://localhost:5000/v1/testContainer"
13 actual := containerURL(&client, "testContainer")
14 if actual != expected {
15 t.Errorf("Unexpected service URL generated: %s", actual)
16 }
17}
18
19func TestObjectURL(t *testing.T) {
20 client := gophercloud.ServiceClient{
21 Endpoint: "http://localhost:5000/v1/",
22 }
23 expected := "http://localhost:5000/v1/testContainer/testObject"
24 actual := objectURL(&client, "testContainer", "testObject")
25 if actual != expected {
26 t.Errorf("Unexpected service URL generated: %s", actual)
27 }
28}