Browse code

Replace uses of deprecated IsErr...Notfound()

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>

Sebastiaan van Stijn authored on 2017/10/03 19:05:03
Showing 8 changed files
... ...
@@ -62,7 +62,7 @@ func TestCheckpointListContainerNotFound(t *testing.T) {
62 62
 	}
63 63
 
64 64
 	_, err := client.CheckpointList(context.Background(), "unknown", types.CheckpointListOptions{})
65
-	if err == nil || !IsErrContainerNotFound(err) {
65
+	if err == nil || !IsErrNotFound(err) {
66 66
 		t.Fatalf("expected a containerNotFound error, got %v", err)
67 67
 	}
68 68
 }
... ...
@@ -42,7 +42,7 @@ func TestConfigInspectConfigNotFound(t *testing.T) {
42 42
 	}
43 43
 
44 44
 	_, _, err := client.ConfigInspectWithRaw(context.Background(), "unknown")
45
-	if err == nil || !IsErrConfigNotFound(err) {
45
+	if err == nil || !IsErrNotFound(err) {
46 46
 		t.Fatalf("expected a configNotFoundError error, got %v", err)
47 47
 	}
48 48
 }
... ...
@@ -53,7 +53,7 @@ func TestConfigInspect(t *testing.T) {
53 53
 		version: "1.30",
54 54
 		client: newMockClient(func(req *http.Request) (*http.Response, error) {
55 55
 			if !strings.HasPrefix(req.URL.Path, expectedURL) {
56
-				return nil, fmt.Errorf("Expected URL '%s', got '%s'", expectedURL, req.URL)
56
+				return nil, fmt.Errorf("expected URL '%s', got '%s'", expectedURL, req.URL)
57 57
 			}
58 58
 			content, err := json.Marshal(swarm.Config{
59 59
 				ID: "config_id",
... ...
@@ -37,7 +37,7 @@ func TestContainerCreateImageNotFound(t *testing.T) {
37 37
 		client: newMockClient(errorMock(http.StatusNotFound, "No such image")),
38 38
 	}
39 39
 	_, err := client.ContainerCreate(context.Background(), &container.Config{Image: "unknown_image"}, nil, nil, "unknown")
40
-	if err == nil || !IsErrImageNotFound(err) {
40
+	if err == nil || !IsErrNotFound(err) {
41 41
 		t.Fatalf("expected an imageNotFound error, got %v", err)
42 42
 	}
43 43
 }
... ...
@@ -30,7 +30,7 @@ func TestContainerInspectContainerNotFound(t *testing.T) {
30 30
 	}
31 31
 
32 32
 	_, err := client.ContainerInspect(context.Background(), "unknown")
33
-	if err == nil || !IsErrContainerNotFound(err) {
33
+	if err == nil || !IsErrNotFound(err) {
34 34
 		t.Fatalf("expected a containerNotFound error, got %v", err)
35 35
 	}
36 36
 }
... ...
@@ -31,7 +31,7 @@ func TestImageInspectImageNotFound(t *testing.T) {
31 31
 	}
32 32
 
33 33
 	_, _, err := client.ImageInspectWithRaw(context.Background(), "unknown")
34
-	if err == nil || !IsErrImageNotFound(err) {
34
+	if err == nil || !IsErrNotFound(err) {
35 35
 		t.Fatalf("expected an imageNotFound error, got %v", err)
36 36
 	}
37 37
 }
... ...
@@ -30,7 +30,7 @@ func TestNodeInspectNodeNotFound(t *testing.T) {
30 30
 	}
31 31
 
32 32
 	_, _, err := client.NodeInspectWithRaw(context.Background(), "unknown")
33
-	if err == nil || !IsErrNodeNotFound(err) {
33
+	if err == nil || !IsErrNotFound(err) {
34 34
 		t.Fatalf("expected a nodeNotFoundError error, got %v", err)
35 35
 	}
36 36
 }
... ...
@@ -42,7 +42,7 @@ func TestSecretInspectSecretNotFound(t *testing.T) {
42 42
 	}
43 43
 
44 44
 	_, _, err := client.SecretInspectWithRaw(context.Background(), "unknown")
45
-	if err == nil || !IsErrSecretNotFound(err) {
45
+	if err == nil || !IsErrNotFound(err) {
46 46
 		t.Fatalf("expected a secretNotFoundError error, got %v", err)
47 47
 	}
48 48
 }
... ...
@@ -31,7 +31,7 @@ func TestServiceInspectServiceNotFound(t *testing.T) {
31 31
 	}
32 32
 
33 33
 	_, _, err := client.ServiceInspectWithRaw(context.Background(), "unknown", types.ServiceInspectOptions{})
34
-	if err == nil || !IsErrServiceNotFound(err) {
34
+	if err == nil || !IsErrNotFound(err) {
35 35
 		t.Fatalf("expected a serviceNotFoundError error, got %v", err)
36 36
 	}
37 37
 }