LEFT | RIGHT |
(no file at all) | |
1 package environs_test | 1 package environs_test |
2 | 2 |
3 import ( | 3 import ( |
4 . "launchpad.net/gocheck" | 4 . "launchpad.net/gocheck" |
5 "launchpad.net/juju-core/environs" | 5 "launchpad.net/juju-core/environs" |
6 _ "launchpad.net/juju-core/environs/dummy" | 6 _ "launchpad.net/juju-core/environs/dummy" |
| 7 "launchpad.net/juju-core/testing" |
7 ) | 8 ) |
8 | 9 |
9 type OpenSuite struct{} | 10 type OpenSuite struct{} |
10 | 11 |
11 var _ = Suite(&OpenSuite{}) | 12 var _ = Suite(&OpenSuite{}) |
12 | 13 |
13 func (OpenSuite) TestNewDummyEnviron(c *C) { | 14 func (OpenSuite) TestNewDummyEnviron(c *C) { |
14 // matches *Settings.Map() | 15 // matches *Settings.Map() |
15 config := map[string]interface{}{ | 16 config := map[string]interface{}{ |
16 "name": "foo", | 17 "name": "foo", |
17 "type": "dummy", | 18 "type": "dummy", |
18 "state-server": false, | 19 "state-server": false, |
19 "authorized-keys": "i-am-a-key", | 20 "authorized-keys": "i-am-a-key", |
20 "admin-secret": "foo", | 21 "admin-secret": "foo", |
| 22 "ca-cert": testing.CACertPEM, |
| 23 "ca-private-key": "", |
21 } | 24 } |
22 env, err := environs.NewFromAttrs(config) | 25 env, err := environs.NewFromAttrs(config) |
23 c.Assert(err, IsNil) | 26 c.Assert(err, IsNil) |
24 c.Assert(env.Bootstrap(false, nil), IsNil) | 27 c.Assert(env.Bootstrap(false, nil), IsNil) |
25 } | 28 } |
26 | 29 |
27 func (OpenSuite) TestNewUnknownEnviron(c *C) { | 30 func (OpenSuite) TestNewUnknownEnviron(c *C) { |
28 env, err := environs.NewFromAttrs(map[string]interface{}{ | 31 env, err := environs.NewFromAttrs(map[string]interface{}{ |
29 "name": "foo", | 32 "name": "foo", |
30 "type": "wondercloud", | 33 "type": "wondercloud", |
31 "authorized-keys": "i-am-a-key", | 34 "authorized-keys": "i-am-a-key", |
| 35 "ca-cert": testing.CACertPEM, |
| 36 "ca-private-key": "", |
32 }) | 37 }) |
33 c.Assert(err, ErrorMatches, "no registered provider for.*") | 38 c.Assert(err, ErrorMatches, "no registered provider for.*") |
34 c.Assert(env, IsNil) | 39 c.Assert(env, IsNil) |
35 } | 40 } |
LEFT | RIGHT |