OLD | NEW |
1 // Copyright 2013 Canonical Ltd. | 1 // Copyright 2013 Canonical Ltd. |
2 // Licensed under the AGPLv3, see LICENCE file for details. | 2 // Licensed under the AGPLv3, see LICENCE file for details. |
3 | 3 |
4 package statecmd_test | 4 package statecmd_test |
5 | 5 |
6 import ( | 6 import ( |
7 gc "launchpad.net/gocheck" | 7 gc "launchpad.net/gocheck" |
| 8 |
8 "launchpad.net/juju-core/charm" | 9 "launchpad.net/juju-core/charm" |
9 "launchpad.net/juju-core/juju/testing" | 10 "launchpad.net/juju-core/juju/testing" |
10 "launchpad.net/juju-core/state/api/params" | 11 "launchpad.net/juju-core/state/api/params" |
11 "launchpad.net/juju-core/state/statecmd" | 12 "launchpad.net/juju-core/state/statecmd" |
12 ) | 13 ) |
13 | 14 |
14 type AddRelationSuite struct { | 15 type AddRelationSuite struct { |
15 testing.JujuConnSuite | 16 testing.JujuConnSuite |
16 } | 17 } |
17 | 18 |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 eps, err := s.State.InferEndpoints([]string{"wordpress", "mysql"}) | 105 eps, err := s.State.InferEndpoints([]string{"wordpress", "mysql"}) |
105 c.Assert(err, gc.IsNil) | 106 c.Assert(err, gc.IsNil) |
106 _, err = s.State.AddRelation(eps...) | 107 _, err = s.State.AddRelation(eps...) |
107 c.Assert(err, gc.IsNil) | 108 c.Assert(err, gc.IsNil) |
108 // And try to add it again. | 109 // And try to add it again. |
109 _, err = statecmd.AddRelation(s.State, params.AddRelation{ | 110 _, err = statecmd.AddRelation(s.State, params.AddRelation{ |
110 Endpoints: []string{"wordpress", "mysql"}, | 111 Endpoints: []string{"wordpress", "mysql"}, |
111 }) | 112 }) |
112 c.Assert(err, gc.ErrorMatches, `cannot add relation "wordpress:db mysql:
server": relation already exists`) | 113 c.Assert(err, gc.ErrorMatches, `cannot add relation "wordpress:db mysql:
server": relation already exists`) |
113 } | 114 } |
OLD | NEW |