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

Delta Between Two Patch Sets: state/conn_test.go

Issue 61620043: Started working on add/remove user support
Left Patch Set: Started working on add/remove user support Created 11 years, 1 month ago
Right Patch Set: Started working on add/remove user support Created 11 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:
Right: Side by side diff | Download
« no previous file with change/comment | « state/apiserver/usermanager/usermanager_test.go ('k') | state/megawatcher_internal_test.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 // Copyright 2012, 2013 Canonical Ltd. 1 // Copyright 2012, 2013 Canonical Ltd.
2 // Licensed under the AGPLv3, see LICENCE file for details. 2 // Licensed under the AGPLv3, see LICENCE file for details.
3 3
4 package state_test 4 package state_test
5 5
6 import ( 6 import (
7 stdtesting "testing" 7 stdtesting "testing"
8 8
9 "labix.org/v2/mgo" 9 "labix.org/v2/mgo"
10 gc "launchpad.net/gocheck" 10 gc "launchpad.net/gocheck"
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 cs.MgoSuite.SetUpTest(c) 52 cs.MgoSuite.SetUpTest(c)
53 cs.policy = mockPolicy{} 53 cs.policy = mockPolicy{}
54 cs.State = state.TestingInitialize(c, nil, &cs.policy) 54 cs.State = state.TestingInitialize(c, nil, &cs.policy)
55 cs.annotations = cs.MgoSuite.Session.DB("juju").C("annotations") 55 cs.annotations = cs.MgoSuite.Session.DB("juju").C("annotations")
56 cs.charms = cs.MgoSuite.Session.DB("juju").C("charms") 56 cs.charms = cs.MgoSuite.Session.DB("juju").C("charms")
57 cs.machines = cs.MgoSuite.Session.DB("juju").C("machines") 57 cs.machines = cs.MgoSuite.Session.DB("juju").C("machines")
58 cs.relations = cs.MgoSuite.Session.DB("juju").C("relations") 58 cs.relations = cs.MgoSuite.Session.DB("juju").C("relations")
59 cs.services = cs.MgoSuite.Session.DB("juju").C("services") 59 cs.services = cs.MgoSuite.Session.DB("juju").C("services")
60 cs.units = cs.MgoSuite.Session.DB("juju").C("units") 60 cs.units = cs.MgoSuite.Session.DB("juju").C("units")
61 cs.stateServers = cs.MgoSuite.Session.DB("juju").C("stateServers") 61 cs.stateServers = cs.MgoSuite.Session.DB("juju").C("stateServers")
62 » cs.State.AddUser("admin", "pass") 62 » cs.State.AddUser(state.AdminUser, "pass")
63 } 63 }
64 64
65 func (cs *ConnSuite) TearDownTest(c *gc.C) { 65 func (cs *ConnSuite) TearDownTest(c *gc.C) {
66 if cs.State != nil { 66 if cs.State != nil {
67 // If setup fails, we don't have a State yet 67 // If setup fails, we don't have a State yet
68 cs.State.Close() 68 cs.State.Close()
69 } 69 }
70 cs.MgoSuite.TearDownTest(c) 70 cs.MgoSuite.TearDownTest(c)
71 cs.LoggingSuite.TearDownTest(c) 71 cs.LoggingSuite.TearDownTest(c)
72 } 72 }
(...skipping 26 matching lines...) Expand all
99 type mockPolicy struct { 99 type mockPolicy struct {
100 getPrechecker func(*config.Config) (state.Prechecker, error) 100 getPrechecker func(*config.Config) (state.Prechecker, error)
101 } 101 }
102 102
103 func (p *mockPolicy) Prechecker(cfg *config.Config) (state.Prechecker, error) { 103 func (p *mockPolicy) Prechecker(cfg *config.Config) (state.Prechecker, error) {
104 if p.getPrechecker != nil { 104 if p.getPrechecker != nil {
105 return p.getPrechecker(cfg) 105 return p.getPrechecker(cfg)
106 } 106 }
107 return nil, errors.NewNotImplementedError("Prechecker") 107 return nil, errors.NewNotImplementedError("Prechecker")
108 } 108 }
LEFTRIGHT

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