~gz/juju-core/trunk

« back to all changes in this revision

Viewing changes to cmd/juju/unexpose_test.go

[r=rogpeppe] all: standardise gocheck imports, A-D

This is an automated change to use "gc" for gocheck
imports throughout. To avoid clogging Rietveld, I've
split it up into three parts - this is the first.

https://codereview.appspot.com/12940044/

Show diffs side-by-side

added added

removed removed

Lines of Context:
4
4
package main
5
5
 
6
6
import (
7
 
        . "launchpad.net/gocheck"
 
7
        gc "launchpad.net/gocheck"
8
8
        "launchpad.net/juju-core/charm"
9
9
        jujutesting "launchpad.net/juju-core/juju/testing"
10
10
        "launchpad.net/juju-core/testing"
14
14
        jujutesting.RepoSuite
15
15
}
16
16
 
17
 
var _ = Suite(&UnexposeSuite{})
 
17
var _ = gc.Suite(&UnexposeSuite{})
18
18
 
19
 
func runUnexpose(c *C, args ...string) error {
 
19
func runUnexpose(c *gc.C, args ...string) error {
20
20
        _, err := testing.RunCommand(c, &UnexposeCommand{}, args)
21
21
        return err
22
22
}
23
23
 
24
 
func (s *UnexposeSuite) assertExposed(c *C, service string, expected bool) {
 
24
func (s *UnexposeSuite) assertExposed(c *gc.C, service string, expected bool) {
25
25
        svc, err := s.State.Service(service)
26
 
        c.Assert(err, IsNil)
 
26
        c.Assert(err, gc.IsNil)
27
27
        actual := svc.IsExposed()
28
 
        c.Assert(actual, Equals, expected)
 
28
        c.Assert(actual, gc.Equals, expected)
29
29
}
30
30
 
31
 
func (s *UnexposeSuite) TestUnexpose(c *C) {
 
31
func (s *UnexposeSuite) TestUnexpose(c *gc.C) {
32
32
        testing.Charms.BundlePath(s.SeriesPath, "dummy")
33
33
        err := runDeploy(c, "local:dummy", "some-service-name")
34
 
        c.Assert(err, IsNil)
 
34
        c.Assert(err, gc.IsNil)
35
35
        curl := charm.MustParseURL("local:precise/dummy-1")
36
36
        s.AssertService(c, "some-service-name", curl, 1, 0)
37
37
 
38
38
        err = runExpose(c, "some-service-name")
39
 
        c.Assert(err, IsNil)
 
39
        c.Assert(err, gc.IsNil)
40
40
        s.assertExposed(c, "some-service-name", true)
41
41
 
42
42
        err = runUnexpose(c, "some-service-name")
43
 
        c.Assert(err, IsNil)
 
43
        c.Assert(err, gc.IsNil)
44
44
        s.assertExposed(c, "some-service-name", false)
45
45
 
46
46
        err = runUnexpose(c, "nonexistent-service")
47
 
        c.Assert(err, ErrorMatches, `service "nonexistent-service" not found`)
 
47
        c.Assert(err, gc.ErrorMatches, `service "nonexistent-service" not found`)
48
48
}