Add some unit tests to the node and swarm cli code
Start work on adding unit tests to our cli code in order to have to write less costly integration test. Signed-off-by: Vincent Demeester <vincent@sbr.pm>
This commit is contained in:
@@ -61,7 +61,7 @@ func (t tasksBySlot) Less(i, j int) bool {
|
||||
// Print task information in a table format.
|
||||
// Besides this, command `docker node ps <node>`
|
||||
// and `docker stack ps` will call this, too.
|
||||
func Print(dockerCli *command.DockerCli, ctx context.Context, tasks []swarm.Task, resolver *idresolver.IDResolver, noTrunc bool) error {
|
||||
func Print(dockerCli command.Cli, ctx context.Context, tasks []swarm.Task, resolver *idresolver.IDResolver, noTrunc bool) error {
|
||||
sort.Stable(tasksBySlot(tasks))
|
||||
|
||||
writer := tabwriter.NewWriter(dockerCli.Out(), 0, 4, 2, ' ', 0)
|
||||
@@ -74,7 +74,7 @@ func Print(dockerCli *command.DockerCli, ctx context.Context, tasks []swarm.Task
|
||||
}
|
||||
|
||||
// PrintQuiet shows task list in a quiet way.
|
||||
func PrintQuiet(dockerCli *command.DockerCli, tasks []swarm.Task) error {
|
||||
func PrintQuiet(dockerCli command.Cli, tasks []swarm.Task) error {
|
||||
sort.Stable(tasksBySlot(tasks))
|
||||
|
||||
out := dockerCli.Out()
|
||||
|
||||
Reference in New Issue
Block a user