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

Delta Between Two Patch Sets: state/conn_test.go

Issue 7598043: Annotation documents and Environment Entity
Left Patch Set: Annotation documents and Environment Entity Created 12 years, 1 month ago
Right Patch Set: Annotation documents and Environment Entity Created 12 years 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 | « state/apiserver/apiserver.go ('k') | state/environ.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
1 package state_test 1 package state_test
2 2
3 import ( 3 import (
4 "fmt"
5 "labix.org/v2/mgo" 4 "labix.org/v2/mgo"
6 . "launchpad.net/gocheck" 5 . "launchpad.net/gocheck"
7 "launchpad.net/juju-core/charm"
8 "launchpad.net/juju-core/state" 6 "launchpad.net/juju-core/state"
9 "launchpad.net/juju-core/testing" 7 "launchpad.net/juju-core/testing"
10 "net/url"
11 stdtesting "testing" 8 stdtesting "testing"
12 ) 9 )
13 10
14 // TestPackage integrates the tests into gotest. 11 // TestPackage integrates the tests into gotest.
15 func TestPackage(t *stdtesting.T) { 12 func TestPackage(t *stdtesting.T) {
16 testing.MgoTestPackage(t) 13 testing.MgoTestPackage(t)
17 } 14 }
18 15
19 // ConnSuite provides the infrastructure for all other 16 // ConnSuite provides the infrastructure for all other
20 // test suites (StateSuite, CharmSuite, MachineSuite, etc). 17 // test suites (StateSuite, CharmSuite, MachineSuite, etc).
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 c.Assert(err, IsNil) 51 c.Assert(err, IsNil)
55 } 52 }
56 53
57 func (cs *ConnSuite) TearDownTest(c *C) { 54 func (cs *ConnSuite) TearDownTest(c *C) {
58 cs.State.Close() 55 cs.State.Close()
59 cs.MgoSuite.TearDownTest(c) 56 cs.MgoSuite.TearDownTest(c)
60 cs.LoggingSuite.TearDownTest(c) 57 cs.LoggingSuite.TearDownTest(c)
61 } 58 }
62 59
63 func (s *ConnSuite) AddTestingCharm(c *C, name string) *state.Charm { 60 func (s *ConnSuite) AddTestingCharm(c *C, name string) *state.Charm {
64 » ch := testing.Charms.Dir(name) 61 » return s.State.AddTestingCharm(c, name)
65 » ident := fmt.Sprintf("%s-%d", name, ch.Revision())
66 » curl := charm.MustParseURL("local:series/" + ident)
67 » bundleURL, err := url.Parse("http://bundles.example.com/" + ident)
68 » c.Assert(err, IsNil)
69 » sch, err := s.State.AddCharm(ch, curl, bundleURL, ident+"-sha256")
70 » c.Assert(err, IsNil)
71 » return sch
72 } 62 }
63
64 // AddConfigCharm clones a testing charm, replaces its config with
65 // the given YAML string and adds it to the state, using the given
66 // revision.
67 func (s *ConnSuite) AddConfigCharm(c *C, name, configYaml string, revision int) *state.Charm {
68 return s.State.AddConfigCharm(c, name, configYaml, revision)
69 }
LEFTRIGHT

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