git-lfs/hawserclient/client_test.go

24 lines
623 B
Go
Raw Normal View History

2015-01-30 18:13:15 +00:00
package hawserclient
import (
"github.com/bmizerany/assert"
2015-01-30 19:08:47 +00:00
"github.com/hawser/git-hawser/hawser"
"testing"
)
func TestObjectUrl(t *testing.T) {
oid := "oid"
tests := map[string]string{
"http://example.com": "http://example.com/objects/oid",
"http://example.com/": "http://example.com/objects/oid",
"http://example.com/foo": "http://example.com/foo/objects/oid",
"http://example.com/foo/": "http://example.com/foo/objects/oid",
}
2015-01-30 18:13:15 +00:00
config := hawser.Config
for endpoint, expected := range tests {
config.SetConfig("media.url", endpoint)
assert.Equal(t, expected, ObjectUrl(oid).String())
}
}