~rogpeppe/juju-core/themue-058-debug-log-api

« back to all changes in this revision

Viewing changes to state/apiserver/charmrevisionupdater/testing/suite.go

  • Committer: Frank Mueller
  • Date: 2014-01-21 08:46:24 UTC
  • mfrom: (2152.1.76 juju-core)
  • Revision ID: frank.mueller@canonical.com-20140121084624-rv32dv6ufzul9h1b
debugger: merged trunk and added access to debugger API facade

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
type CharmSuite struct {
23
23
        jujutesting.JujuConnSuite
24
24
 
25
 
        server *charmtesting.MockStore
 
25
        Server *charmtesting.MockStore
26
26
        charms map[string]*state.Charm
27
27
}
28
28
 
29
29
func (s *CharmSuite) SetUpSuite(c *gc.C) {
30
30
        s.JujuConnSuite.SetUpSuite(c)
31
 
        s.server = charmtesting.NewMockStore(c, map[string]int{
 
31
        s.Server = charmtesting.NewMockStore(c, map[string]int{
32
32
                "cs:quantal/mysql":     23,
33
33
                "cs:quantal/dummy":     24,
34
34
                "cs:quantal/riak":      25,
41
41
func (s *CharmSuite) SetUpTest(c *gc.C) {
42
42
        s.JujuConnSuite.SetUpTest(c)
43
43
        s.PatchValue(&charm.CacheDir, c.MkDir())
44
 
        s.PatchValue(&charm.Store, &charm.CharmStore{BaseURL: s.server.Address()})
45
 
        s.server.Downloads = nil
46
 
        s.server.Authorizations = nil
 
44
        s.PatchValue(&charm.Store, &charm.CharmStore{BaseURL: s.Server.Address()})
 
45
        s.Server.Downloads = nil
 
46
        s.Server.Authorizations = nil
 
47
        s.Server.Metadata = nil
47
48
        s.charms = make(map[string]*state.Charm)
48
49
}
49
50
 
50
51
func (s *CharmSuite) TearDownSuite(c *gc.C) {
51
 
        s.server.Close()
 
52
        s.Server.Close()
52
53
        s.JujuConnSuite.TearDownSuite(c)
53
54
}
54
55
 
 
56
// UpdateStoreRevision sets the revision of the specified charm to rev.
 
57
func (s *CharmSuite) UpdateStoreRevision(ch string, rev int) {
 
58
        s.Server.UpdateStoreRevision(ch, rev)
 
59
}
 
60
 
55
61
// AddMachine adds a new machine to state.
56
62
func (s *CharmSuite) AddMachine(c *gc.C, machineId string, job state.MachineJob) {
57
63
        m, err := s.State.AddOneMachine(state.MachineTemplate{