client/plugin: use gotest.tools-style asserts

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
This commit is contained in:
Paweł Gronowski
2025-05-16 19:14:42 +02:00
parent 832efcd672
commit 44f30261da
7 changed files with 9 additions and 27 deletions

View File

@@ -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)
}

View File

@@ -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)
}

View File

@@ -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"))
}

View File

@@ -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))
}
}

View File

@@ -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)
}

View File

@@ -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)
}

View File

@@ -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)
}