summaryrefslogtreecommitdiff
path: root/client/task_inspect_test.go
diff options
context:
space:
mode:
authorTõnis Tiigi <tonistiigi@gmail.com>2018-02-16 10:18:47 -0800
committerGitHub <noreply@github.com>2018-02-16 10:18:47 -0800
commitdb360995df97f9d9bcb4eb6a34a5c35a2711795b (patch)
tree04019ecfcce62e8e70853e9bd5e59a1b0c86e70a /client/task_inspect_test.go
parent302e584b78db16ea39aca7d7c1612370c50d20f5 (diff)
parent3e6bbefd268f51755be5af0644995297a71a05d7 (diff)
downloaddocker-db360995df97f9d9bcb4eb6a34a5c35a2711795b.tar.gz
Merge pull request #36144 from emil2k/node-id-required
Produce errors when empty ids are passed into inspect calls.
Diffstat (limited to 'client/task_inspect_test.go')
-rw-r--r--client/task_inspect_test.go13
1 files changed, 13 insertions, 0 deletions
diff --git a/client/task_inspect_test.go b/client/task_inspect_test.go
index 6adba9219f..6ca98dde9c 100644
--- a/client/task_inspect_test.go
+++ b/client/task_inspect_test.go
@@ -10,6 +10,7 @@ import (
"testing"
"github.com/docker/docker/api/types/swarm"
+ "github.com/pkg/errors"
"golang.org/x/net/context"
)
@@ -24,6 +25,18 @@ func TestTaskInspectError(t *testing.T) {
}
}
+func TestTaskInspectWithEmptyID(t *testing.T) {
+ client := &Client{
+ client: newMockClient(func(req *http.Request) (*http.Response, error) {
+ return nil, errors.New("should not make request")
+ }),
+ }
+ _, _, err := client.TaskInspectWithRaw(context.Background(), "")
+ if !IsErrNotFound(err) {
+ t.Fatalf("Expected NotFoundError, got %v", err)
+ }
+}
+
func TestTaskInspect(t *testing.T) {
expectedURL := "/tasks/task_id"
client := &Client{