mirror of
https://github.com/moby/moby.git
synced 2026-01-11 18:51:37 +00:00
client: refactor SearchOptions to ImageSearchOptions
Signed-off-by: Austin Vazquez <austin.vazquez@docker.com>
This commit is contained in:
@@ -22,7 +22,7 @@ func TestImageSearchAnyError(t *testing.T) {
|
||||
client := &Client{
|
||||
client: newMockClient(errorMock(http.StatusInternalServerError, "Server error")),
|
||||
}
|
||||
_, err := client.ImageSearch(context.Background(), "some-image", SearchOptions{})
|
||||
_, err := client.ImageSearch(context.Background(), "some-image", ImageSearchOptions{})
|
||||
assert.Check(t, is.ErrorType(err, cerrdefs.IsInternal))
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@ func TestImageSearchStatusUnauthorizedError(t *testing.T) {
|
||||
client := &Client{
|
||||
client: newMockClient(errorMock(http.StatusUnauthorized, "Unauthorized error")),
|
||||
}
|
||||
_, err := client.ImageSearch(context.Background(), "some-image", SearchOptions{})
|
||||
_, err := client.ImageSearch(context.Background(), "some-image", ImageSearchOptions{})
|
||||
assert.Check(t, is.ErrorType(err, cerrdefs.IsUnauthorized))
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ func TestImageSearchWithUnauthorizedErrorAndPrivilegeFuncError(t *testing.T) {
|
||||
privilegeFunc := func(_ context.Context) (string, error) {
|
||||
return "", errors.New("Error requesting privilege")
|
||||
}
|
||||
_, err := client.ImageSearch(context.Background(), "some-image", SearchOptions{
|
||||
_, err := client.ImageSearch(context.Background(), "some-image", ImageSearchOptions{
|
||||
PrivilegeFunc: privilegeFunc,
|
||||
})
|
||||
assert.Check(t, is.Error(err, "Error requesting privilege"))
|
||||
@@ -54,7 +54,7 @@ func TestImageSearchWithUnauthorizedErrorAndAnotherUnauthorizedError(t *testing.
|
||||
privilegeFunc := func(_ context.Context) (string, error) {
|
||||
return "a-auth-header", nil
|
||||
}
|
||||
_, err := client.ImageSearch(context.Background(), "some-image", SearchOptions{
|
||||
_, err := client.ImageSearch(context.Background(), "some-image", ImageSearchOptions{
|
||||
PrivilegeFunc: privilegeFunc,
|
||||
})
|
||||
assert.Check(t, is.ErrorType(err, cerrdefs.IsUnauthorized))
|
||||
@@ -99,7 +99,7 @@ func TestImageSearchWithPrivilegedFuncNoError(t *testing.T) {
|
||||
privilegeFunc := func(_ context.Context) (string, error) {
|
||||
return "IAmValid", nil
|
||||
}
|
||||
results, err := client.ImageSearch(context.Background(), "some-image", SearchOptions{
|
||||
results, err := client.ImageSearch(context.Background(), "some-image", ImageSearchOptions{
|
||||
RegistryAuth: "NotValid",
|
||||
PrivilegeFunc: privilegeFunc,
|
||||
})
|
||||
@@ -139,7 +139,7 @@ func TestImageSearchWithoutErrors(t *testing.T) {
|
||||
}, nil
|
||||
}),
|
||||
}
|
||||
results, err := client.ImageSearch(context.Background(), "some-image", SearchOptions{
|
||||
results, err := client.ImageSearch(context.Background(), "some-image", ImageSearchOptions{
|
||||
Filters: filters.NewArgs(
|
||||
filters.Arg("is-automated", "true"),
|
||||
filters.Arg("stars", "3"),
|
||||
|
||||
Reference in New Issue
Block a user