Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(46)

Delta Between Two Patch Sets: environs/open_test.go

Issue 6850087: environs/config: make CA cert optional
Left Patch Set: environs/config: make CA cert optional Created 12 years, 4 months ago
Right Patch Set: environs/config: make CA cert optional Created 12 years, 4 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
Right: Side by side diff | Download
« no previous file with change/comment | « environs/ec2/local_test.go ('k') | environs/openstack/config.go » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
(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 }
LEFTRIGHT

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b