registry: getting Endpoint ironned out

Signed-off-by: Vincent Batts <vbatts@redhat.com>
This commit is contained in:
Vincent Batts 2014-08-26 16:21:04 -07:00 committed by Derek McGowan
parent 48b43c2645
commit d629bebce2
6 changed files with 177 additions and 103 deletions

View file

@ -18,7 +18,11 @@ var (
func spawnTestRegistrySession(t *testing.T) *Session {
authConfig := &AuthConfig{}
r, err := NewSession(authConfig, utils.NewHTTPRequestFactory(), makeURL("/v1/"), true)
endpoint, err := NewEndpoint(makeURL("/v1/"))
if err != nil {
t.Fatal(err)
}
r, err := NewSession(authConfig, utils.NewHTTPRequestFactory(), endpoint, true)
if err != nil {
t.Fatal(err)
}
@ -26,7 +30,11 @@ func spawnTestRegistrySession(t *testing.T) *Session {
}
func TestPingRegistryEndpoint(t *testing.T) {
regInfo, err := pingRegistryEndpoint(makeURL("/v1/"))
ep, err := NewEndpoint(makeURL("/v1/"))
if err != nil {
t.Fatal(err)
}
regInfo, err := ep.Ping()
if err != nil {
t.Fatal(err)
}
@ -197,7 +205,7 @@ func TestPushImageJSONIndex(t *testing.T) {
if repoData == nil {
t.Fatal("Expected RepositoryData object")
}
repoData, err = r.PushImageJSONIndex("foo42/bar", imgData, true, []string{r.indexEndpoint})
repoData, err = r.PushImageJSONIndex("foo42/bar", imgData, true, []string{r.indexEndpoint.String()})
if err != nil {
t.Fatal(err)
}