~ubuntu-branches/ubuntu/trusty/juju-core/trusty-proposed

« back to all changes in this revision

Viewing changes to src/launchpad.net/juju-core/state/apiserver/common/password_test.go

  • Committer: Package Import Robot
  • Author(s): James Page
  • Date: 2014-02-03 09:22:46 UTC
  • mfrom: (1.1.17)
  • Revision ID: package-import@ubuntu.com-20140203092246-e03vg402vztzo4qa
Tags: 1.17.2-0ubuntu1
New upstream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
13
13
        "launchpad.net/juju-core/state/api/params"
14
14
        "launchpad.net/juju-core/state/apiserver/common"
15
15
        apiservertesting "launchpad.net/juju-core/state/apiserver/testing"
 
16
        jc "launchpad.net/juju-core/testing/checkers"
16
17
)
17
18
 
18
19
type passwordSuite struct{}
107
108
                        },
108
109
                        "x4": &fakeUnitAuthenticator{},
109
110
                        "x5": &fakeMachineAuthenticator{jobs: []state.MachineJob{state.JobHostUnits}},
110
 
                        "x6": &fakeMachineAuthenticator{jobs: []state.MachineJob{state.JobManageState}},
111
 
                        "x7": &fakeMachineAuthenticator{jobs: []state.MachineJob{state.JobManageEnviron}},
 
111
                        "x6": &fakeMachineAuthenticator{jobs: []state.MachineJob{state.JobManageEnviron}},
112
112
                },
113
113
        }
114
114
        getCanChange := func() (common.AuthFunc, error) {
129
129
                Changes: changes,
130
130
        })
131
131
        c.Assert(err, gc.IsNil)
132
 
        c.Assert(results, gc.DeepEquals, params.ErrorResults{
 
132
        c.Assert(results, jc.DeepEquals, params.ErrorResults{
133
133
                Results: []params.ErrorResult{
134
134
                        {apiservertesting.ErrUnauthorized},
135
135
                        {nil},
138
138
                        {nil},
139
139
                        {nil},
140
140
                        {nil},
141
 
                        {nil},
142
141
                },
143
142
        })
144
143
        c.Check(st.entities["x0"].(*fakeAuthenticator).pass, gc.Equals, "")
150
149
        c.Check(st.entities["x5"].(*fakeMachineAuthenticator).mongoPass, gc.Equals, "")
151
150
        c.Check(st.entities["x6"].(*fakeMachineAuthenticator).pass, gc.Equals, "x6pass")
152
151
        c.Check(st.entities["x6"].(*fakeMachineAuthenticator).mongoPass, gc.Equals, "x6pass")
153
 
        c.Check(st.entities["x7"].(*fakeMachineAuthenticator).pass, gc.Equals, "x7pass")
154
 
        c.Check(st.entities["x7"].(*fakeMachineAuthenticator).mongoPass, gc.Equals, "x7pass")
155
152
}
156
153
 
157
154
func (*passwordSuite) TestSetPasswordsError(c *gc.C) {