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

Delta Between Two Patch Sets: juju/testing/conn.go

Issue 6488077: juju: always connect to State.
Left Patch Set: juju: always connect to State. Created 12 years, 7 months ago
Right Patch Set: juju: always connect to State. Created 12 years, 7 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:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « juju/deploy_test.go ('k') | no next file » | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
1 package testing 1 package testing
2 2
3 import ( 3 import (
4 "fmt" 4 "fmt"
5 "io/ioutil" 5 "io/ioutil"
6 . "launchpad.net/gocheck" 6 . "launchpad.net/gocheck"
7 "launchpad.net/juju-core/charm" 7 "launchpad.net/juju-core/charm"
8 "launchpad.net/juju-core/environs" 8 "launchpad.net/juju-core/environs"
9 "launchpad.net/juju-core/environs/dummy" 9 "launchpad.net/juju-core/environs/dummy"
10 "launchpad.net/juju-core/juju" 10 "launchpad.net/juju-core/juju"
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 92
93 err = ioutil.WriteFile(filepath.Join(home, ".juju", "environments.yaml") , config, 0600) 93 err = ioutil.WriteFile(filepath.Join(home, ".juju", "environments.yaml") , config, 0600)
94 c.Assert(err, IsNil) 94 c.Assert(err, IsNil)
95 95
96 environ, err := environs.NewFromName("dummyenv") 96 environ, err := environs.NewFromName("dummyenv")
97 c.Assert(err, IsNil) 97 c.Assert(err, IsNil)
98 // sanity check we've got the correct environment. 98 // sanity check we've got the correct environment.
99 c.Assert(environ.Name(), Equals, "dummyenv") 99 c.Assert(environ.Name(), Equals, "dummyenv")
100 c.Assert(environ.Bootstrap(false), IsNil) 100 c.Assert(environ.Bootstrap(false), IsNil)
101 101
102 » conn, err := juju.NewConn("dummyenv") 102 » conn, err := juju.NewConnFromName("dummyenv")
103 c.Assert(err, IsNil) 103 c.Assert(err, IsNil)
104 s.Conn = conn 104 s.Conn = conn
105 s.State = conn.State 105 s.State = conn.State
106 c.Assert(err, IsNil) 106 c.Assert(err, IsNil)
107 } 107 }
108 108
109 func (s *JujuConnSuite) tearDownConn(c *C) { 109 func (s *JujuConnSuite) tearDownConn(c *C) {
110 dummy.Reset() 110 dummy.Reset()
111 c.Assert(s.Conn.Close(), IsNil) 111 c.Assert(s.Conn.Close(), IsNil)
112 s.Conn = nil 112 s.Conn = nil
(...skipping 24 matching lines...) Expand all
137 func (s *JujuConnSuite) AddTestingCharm(c *C, name string) *state.Charm { 137 func (s *JujuConnSuite) AddTestingCharm(c *C, name string) *state.Charm {
138 ch := testing.Charms.Dir(name) 138 ch := testing.Charms.Dir(name)
139 ident := fmt.Sprintf("%s-%d", name, ch.Revision()) 139 ident := fmt.Sprintf("%s-%d", name, ch.Revision())
140 curl := charm.MustParseURL("local:series/" + ident) 140 curl := charm.MustParseURL("local:series/" + ident)
141 bundleURL, err := url.Parse("http://bundles.example.com/" + ident) 141 bundleURL, err := url.Parse("http://bundles.example.com/" + ident)
142 c.Assert(err, IsNil) 142 c.Assert(err, IsNil)
143 sch, err := s.State.AddCharm(ch, curl, bundleURL, ident+"-sha256") 143 sch, err := s.State.AddCharm(ch, curl, bundleURL, ident+"-sha256")
144 c.Assert(err, IsNil) 144 c.Assert(err, IsNil)
145 return sch 145 return sch
146 } 146 }
LEFTRIGHT

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