mirror of
https://github.com/moby/moby.git
synced 2026-01-11 18:51:37 +00:00
client/plugin: use gotest.tools-style asserts
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
This commit is contained in:
@@ -51,7 +51,5 @@ func TestPluginDisable(t *testing.T) {
|
||||
}
|
||||
|
||||
err := client.PluginDisable(context.Background(), "plugin_name", types.PluginDisableOptions{})
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.NilError(t, err)
|
||||
}
|
||||
|
||||
@@ -51,7 +51,5 @@ func TestPluginEnable(t *testing.T) {
|
||||
}
|
||||
|
||||
err := client.PluginEnable(context.Background(), "plugin_name", types.PluginEnableOptions{})
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.NilError(t, err)
|
||||
}
|
||||
|
||||
@@ -62,10 +62,6 @@ func TestPluginInspect(t *testing.T) {
|
||||
}
|
||||
|
||||
pluginInspect, _, err := client.PluginInspectWithRaw(context.Background(), "plugin_name")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if pluginInspect.ID != "plugin_id" {
|
||||
t.Fatalf("expected `plugin_id`, got %s", pluginInspect.ID)
|
||||
}
|
||||
assert.NilError(t, err)
|
||||
assert.Check(t, is.Equal(pluginInspect.ID, "plugin_id"))
|
||||
}
|
||||
|
||||
@@ -94,11 +94,7 @@ func TestPluginList(t *testing.T) {
|
||||
}
|
||||
|
||||
plugins, err := client.PluginList(context.Background(), listCase.filters)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if len(plugins) != 2 {
|
||||
t.Fatalf("expected 2 plugins, got %v", plugins)
|
||||
}
|
||||
assert.NilError(t, err)
|
||||
assert.Check(t, is.Len(plugins, 2))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -55,7 +55,5 @@ func TestPluginPush(t *testing.T) {
|
||||
}
|
||||
|
||||
_, err := client.PluginPush(context.Background(), "plugin_name", "authtoken")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.NilError(t, err)
|
||||
}
|
||||
|
||||
@@ -51,7 +51,5 @@ func TestPluginRemove(t *testing.T) {
|
||||
}
|
||||
|
||||
err := client.PluginRemove(context.Background(), "plugin_name", types.PluginRemoveOptions{})
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.NilError(t, err)
|
||||
}
|
||||
|
||||
@@ -50,7 +50,5 @@ func TestPluginSet(t *testing.T) {
|
||||
}
|
||||
|
||||
err := client.PluginSet(context.Background(), "plugin_name", []string{"arg1"})
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.NilError(t, err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user