Chnage LookupRemoteImage to return error

This commit is patch for following comment
// TODO: This method should return the errors instead of masking them and returning false

Signed-off-by: Daehyeok Mun <daehyeok@gmail.com>
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
This commit is contained in:
Daehyeok Mun 2014-11-16 22:25:10 +09:00 committed by Michael Crosby
parent 7804b2ca82
commit b11b1e06e9
2 changed files with 12 additions and 12 deletions

View file

@ -58,10 +58,11 @@ func TestGetRemoteHistory(t *testing.T) {
func TestLookupRemoteImage(t *testing.T) {
r := spawnTestRegistrySession(t)
found := r.LookupRemoteImage(imageID, makeURL("/v1/"), token)
assertEqual(t, found, true, "Expected remote lookup to succeed")
found = r.LookupRemoteImage("abcdef", makeURL("/v1/"), token)
assertEqual(t, found, false, "Expected remote lookup to fail")
err := r.LookupRemoteImage(imageID, makeURL("/v1/"), token)
assertEqual(t, err, nil, "Expected error of remote lookup to nil")
if err := r.LookupRemoteImage("abcdef", makeURL("/v1/"), token); err == nil {
t.Fatal("Expected error of remote lookup to not nil")
}
}
func TestGetRemoteImageJSON(t *testing.T) {