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

« back to all changes in this revision

Viewing changes to src/github.com/juju/juju/worker/deployer/deployer_test.go

  • Committer: Martin Packman
  • Date: 2016-03-30 19:31:08 UTC
  • mfrom: (1.1.41)
  • Revision ID: martin.packman@canonical.com-20160330193108-h9iz3ak334uk0z5r
Merge new upstream source 2.0~beta3

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
        apideployer "github.com/juju/juju/api/deployer"
17
17
        jujutesting "github.com/juju/juju/juju/testing"
18
18
        "github.com/juju/juju/state"
 
19
        "github.com/juju/juju/status"
19
20
        coretesting "github.com/juju/juju/testing"
20
21
        "github.com/juju/juju/worker"
21
22
        "github.com/juju/juju/worker/deployer"
76
77
        s.waitFor(c, isDeployed(ctx, u0.Name(), u1.Name()))
77
78
 
78
79
        // Cause a unit to become Dying, and check no change.
79
 
        err = u1.SetAgentStatus(state.StatusIdle, "", nil)
 
80
        err = u1.SetAgentStatus(status.StatusIdle, "", nil)
80
81
        c.Assert(err, jc.ErrorIsNil)
81
82
        err = u1.Destroy()
82
83
        c.Assert(err, jc.ErrorIsNil)
119
120
        // note: this is not a sane state; for the unit to have a status it must
120
121
        // have been deployed. But it's instructive to check that the right thing
121
122
        // would happen if it were possible to have a dying unit in this situation.
122
 
        err = u1.SetAgentStatus(state.StatusIdle, "", nil)
 
123
        err = u1.SetAgentStatus(status.StatusIdle, "", nil)
123
124
        c.Assert(err, jc.ErrorIsNil)
124
125
        err = u1.Destroy()
125
126
        c.Assert(err, jc.ErrorIsNil)