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

« back to all changes in this revision

Viewing changes to src/github.com/juju/romulus/cmd/cmd_test.go

  • Committer: Martin Packman
  • Date: 2016-03-30 19:31:08 UTC
  • mfrom: (1.1.41)
  • Revision ID: martin.packman@canonical.com-20160330193108-h9iz3ak334uk0z5r
Merge new upstream source 2.0~beta3

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
// Copyright 2016 Canonical Ltd.
2
 
// Licensed under the AGPLv3, see LICENCE file for details.
3
 
 
4
 
package cmd_test
5
 
 
6
 
import (
7
 
        gc "gopkg.in/check.v1"
8
 
        stdtesting "testing"
9
 
 
10
 
        jujucmd "github.com/juju/cmd"
11
 
        "github.com/juju/cmd/cmdtesting"
12
 
        "github.com/juju/testing"
13
 
        jc "github.com/juju/testing/checkers"
14
 
 
15
 
        "github.com/juju/romulus/cmd"
16
 
)
17
 
 
18
 
func TestPackage(t *stdtesting.T) {
19
 
        gc.TestingT(t)
20
 
}
21
 
 
22
 
type httpSuite struct {
23
 
        testing.CleanupSuite
24
 
        caCert string
25
 
}
26
 
 
27
 
var _ = gc.Suite(&httpSuite{})
28
 
 
29
 
type testCommand struct {
30
 
        cmd.HttpCommand
31
 
}
32
 
 
33
 
func (c *testCommand) Info() *jujucmd.Info {
34
 
        return &jujucmd.Info{Name: "test"}
35
 
}
36
 
 
37
 
func (c *testCommand) Run(ctx *jujucmd.Context) error {
38
 
        return nil
39
 
}
40
 
 
41
 
func (s *httpSuite) TestNewClient(c *gc.C) {
42
 
        basecmd := &testCommand{}
43
 
        defer basecmd.Close()
44
 
 
45
 
        _, err := cmdtesting.RunCommand(c, basecmd)
46
 
        c.Assert(err, jc.ErrorIsNil)
47
 
 
48
 
        client, err := basecmd.NewClient()
49
 
        c.Assert(err, jc.ErrorIsNil)
50
 
        c.Assert(client, gc.NotNil)
51
 
}