~juju-qa/ubuntu/xenial/juju/2.0-rc2

« back to all changes in this revision

Viewing changes to src/github.com/juju/juju/apiserver/common/machine_test.go

  • Committer: Nicholas Skaggs
  • Date: 2016-09-30 14:39:30 UTC
  • mfrom: (1.8.1)
  • Revision ID: nicholas.skaggs@canonical.com-20160930143930-vwwhrefh6ftckccy
import upstream

Show diffs side-by-side

added added

removed removed

Lines of Context:
121
121
func (s *machineSuite) TestMachineInstanceInfo(c *gc.C) {
122
122
        st := mockState{
123
123
                machines: map[string]*mockMachine{
124
 
                        "1": {id: "1", instId: instance.Id("123"), status: status.StatusDown, hasVote: true, wantsVote: true},
 
124
                        "1": {id: "1", instId: instance.Id("123"), status: status.Down, hasVote: true, wantsVote: true},
125
125
                },
126
126
        }
127
127
        info, err := common.ModelMachineInfo(&st)
171
171
        instId             instance.Id
172
172
        hasVote, wantsVote bool
173
173
        status             status.Status
 
174
        statusErr          error
174
175
        destroyErr         error
175
176
        forceDestroyErr    error
176
177
        forceDestroyCalled bool
177
178
        destroyCalled      bool
 
179
        agentDead          bool
 
180
        presenceErr        error
178
181
}
179
182
 
180
183
func (m *mockMachine) Id() string {
200
203
func (m *mockMachine) Status() (status.StatusInfo, error) {
201
204
        return status.StatusInfo{
202
205
                Status: m.status,
203
 
        }, nil
 
206
        }, m.statusErr
204
207
}
205
208
 
206
209
func (m *mockMachine) HardwareCharacteristics() (*instance.HardwareCharacteristics, error) {
207
210
        return m.hw, nil
208
211
}
209
212
 
 
213
func (m *mockMachine) AgentPresence() (bool, error) {
 
214
        return !m.agentDead, m.presenceErr
 
215
}
 
216
 
210
217
func (m *mockMachine) ForceDestroy() error {
211
218
        m.forceDestroyCalled = true
212
219
        if m.forceDestroyErr != nil {