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

Unified Diff: environs/open_test.go

Issue 6215045: environs: add NewEnviron(kind, config) (Closed)
Patch Set: environs: add NewEnviron(kind, config) Created 12 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « environs/open.go ('k') | state/util.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: environs/open_test.go
=== added file 'environs/open_test.go'
--- environs/open_test.go 1970-01-01 00:00:00 +0000
+++ environs/open_test.go 2012-05-15 07:28:38 +0000
@@ -0,0 +1,28 @@
+package environs_test
+
+import (
+ . "launchpad.net/gocheck"
+ "launchpad.net/juju/go/environs"
+ _ "launchpad.net/juju/go/environs/dummy"
+)
+
+type OpenSuite struct{}
+
+var _ = Suite(&OpenSuite{})
+
+func (OpenSuite) TestNewDummyEnviron(c *C) {
+ // matches *ConfigNode.Map()
+ config := map[string]interface{}{
+ "type": "dummy",
+ "zookeeper": false,
+ }
+ env, err := environs.NewEnviron("dummy", config)
+ c.Assert(err, IsNil)
+ c.Assert(env.Bootstrap(), IsNil)
+}
+
+func (OpenSuite) TestNewUnknownEnviron(c *C) {
+ env, err := environs.NewEnviron("wondercloud", nil)
+ c.Assert(err, ErrorMatches, "no registered provider for kind:.*")
+ c.Assert(env, IsNil)
+}
« no previous file with comments | « environs/open.go ('k') | state/util.go » ('j') | no next file with comments »

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