~sidnei/juju-core/lxc-clone-with-overlayfs

« back to all changes in this revision

Viewing changes to state/endpoint_test.go

  • Committer: Sidnei da Silva
  • Date: 2013-10-21 18:33:07 UTC
  • mfrom: (1667.1.329 juju-core)
  • Revision ID: sidnei.da.silva@canonical.com-20131021183307-fylyr68s4gtbxr08
- Merge from trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
4
4
package state_test
5
5
 
6
6
import (
7
 
        . "launchpad.net/gocheck"
 
7
        gc "launchpad.net/gocheck"
8
8
 
9
9
        "launchpad.net/juju-core/charm"
10
10
        "launchpad.net/juju-core/state"
13
13
type EndpointSuite struct {
14
14
}
15
15
 
16
 
var _ = Suite(&EndpointSuite{})
 
16
var _ = gc.Suite(&EndpointSuite{})
17
17
 
18
18
var canRelateTests = []struct {
19
19
        role1, role2 charm.RelationRole
27
27
        {charm.RolePeer, charm.RolePeer, false},
28
28
}
29
29
 
30
 
func (s *EndpointSuite) TestCanRelate(c *C) {
 
30
func (s *EndpointSuite) TestCanRelate(c *gc.C) {
31
31
        for i, t := range canRelateTests {
32
32
                c.Logf("test %d", i)
33
33
                ep1 := state.Endpoint{
49
49
                        },
50
50
                }
51
51
                if t.success {
52
 
                        c.Assert(ep1.CanRelateTo(ep2), Equals, true)
53
 
                        c.Assert(ep2.CanRelateTo(ep1), Equals, true)
 
52
                        c.Assert(ep1.CanRelateTo(ep2), gc.Equals, true)
 
53
                        c.Assert(ep2.CanRelateTo(ep1), gc.Equals, true)
54
54
                        ep1.Interface = "different"
55
55
                }
56
 
                c.Assert(ep1.CanRelateTo(ep2), Equals, false)
57
 
                c.Assert(ep2.CanRelateTo(ep1), Equals, false)
 
56
                c.Assert(ep1.CanRelateTo(ep2), gc.Equals, false)
 
57
                c.Assert(ep2.CanRelateTo(ep1), gc.Equals, false)
58
58
        }
59
59
        ep1 := state.Endpoint{
60
60
                ServiceName: "same-service",
74
74
                        Scope:     charm.ScopeGlobal,
75
75
                },
76
76
        }
77
 
        c.Assert(ep1.CanRelateTo(ep2), Equals, false)
78
 
        c.Assert(ep2.CanRelateTo(ep1), Equals, false)
 
77
        c.Assert(ep1.CanRelateTo(ep2), gc.Equals, false)
 
78
        c.Assert(ep2.CanRelateTo(ep1), gc.Equals, false)
79
79
}