2024-02-21 10:36:17 -05:00
|
|
|
package builder
|
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
|
|
|
"errors"
|
|
|
|
"testing"
|
|
|
|
|
|
|
|
"github.com/docker/cli/internal/test"
|
|
|
|
"github.com/docker/docker/api/types"
|
|
|
|
)
|
|
|
|
|
|
|
|
func TestBuilderPromptTermination(t *testing.T) {
|
|
|
|
ctx, cancel := context.WithCancel(context.Background())
|
|
|
|
t.Cleanup(cancel)
|
|
|
|
|
|
|
|
cli := test.NewFakeCli(&fakeClient{
|
|
|
|
builderPruneFunc: func(ctx context.Context, opts types.BuildCachePruneOptions) (*types.BuildCachePruneReport, error) {
|
|
|
|
return nil, errors.New("fakeClient builderPruneFunc should not be called")
|
|
|
|
},
|
|
|
|
})
|
|
|
|
cmd := NewPruneCommand(cli)
|
2024-03-12 07:38:47 -04:00
|
|
|
test.TerminatePrompt(ctx, t, cmd, cli)
|
2024-02-21 10:36:17 -05:00
|
|
|
}
|