~juju-qa/ubuntu/xenial/juju/2.0-rc2

« back to all changes in this revision

Viewing changes to src/github.com/juju/juju/cmd/juju/action/list_test.go

  • Committer: Nicholas Skaggs
  • Date: 2016-09-30 14:39:30 UTC
  • mfrom: (1.8.1)
  • Revision ID: nicholas.skaggs@canonical.com-20160930143930-vwwhrefh6ftckccy
import upstream

Show diffs side-by-side

added added

removed removed

Lines of Context:
6
6
import (
7
7
        "bytes"
8
8
        "errors"
 
9
        "fmt"
9
10
        "strings"
10
11
 
11
12
        "github.com/juju/cmd"
122
123
                should:          "work properly when no results found",
123
124
                withArgs:        []string{validServiceId},
124
125
                expectNoResults: true,
125
 
                expectMessage:   "No actions defined for " + validServiceId,
 
126
                expectMessage:   fmt.Sprintf("No actions defined for %s.\n", validServiceId),
126
127
        }}
127
128
 
128
129
        for i, t := range tests {
149
150
                                        if t.expectFullSchema {
150
151
                                                checkFullSchema(c, t.withCharmActions, result)
151
152
                                        } else if t.expectNoResults {
152
 
                                                c.Check(string(result), gc.Matches, t.expectMessage+"(?sm).*")
 
153
                                                c.Check(testing.Stderr(ctx), gc.Matches, t.expectMessage)
153
154
                                        } else {
154
155
                                                c.Check(testing.Stdout(ctx), gc.Equals, simpleOutput)
155
156
                                        }