~rogpeppe/juju-core/azure

« back to all changes in this revision

Viewing changes to juju/conn_test.go

[r=wallyworld] add-unit supports the force-machine argument

Semantics are the same as for deploy. Only one unit
can be added with force-machine, or else an error
occurs.

https://codereview.appspot.com/10962046/

Show diffs side-by-side

added added

removed removed

Lines of Context:
513
513
        s.assertMachines(c, service, constraints.MustParse("mem=2G cpu-cores=2"), "0", "1")
514
514
}
515
515
 
 
516
func (s *DeployLocalSuite) TestDeployWithForceMachineRejectsTooManyUnits(c *C) {
 
517
        machine, err := s.State.AddMachine("series", state.JobHostUnits)
 
518
        c.Assert(err, IsNil)
 
519
        c.Assert(machine.Id(), Equals, "0")
 
520
        _, err = s.Conn.DeployService(juju.DeployServiceParams{
 
521
                ServiceName:      "bob",
 
522
                Charm:            s.charm,
 
523
                NumUnits:         2,
 
524
                ForceMachineSpec: "0",
 
525
        })
 
526
        c.Assert(err, ErrorMatches, "cannot use --num-units with --force-machine")
 
527
}
 
528
 
516
529
func (s *DeployLocalSuite) TestDeployForceMachineId(c *C) {
517
530
        machine, err := s.State.AddMachine("series", state.JobHostUnits)
518
531
        c.Assert(err, IsNil)