~gz/juju-core/trunk

« back to all changes in this revision

Viewing changes to state/state_test.go

  • Committer: Tarmac
  • Author(s): William Reade
  • Date: 2013-08-19 11:08:49 UTC
  • mfrom: (1600.4.4 juju-core)
  • Revision ID: tarmac-20130819110849-5apob3ixr6hzzx3y
[r=fwereade] state: WatchContainers works again

Sorry I broke it. Now includes somewhat improved tests, that will hopefully
prevent us from doing so again.

https://codereview.appspot.com/12539043/

Show diffs side-by-side

added added

removed removed

Lines of Context:
961
961
        c.Assert(err, gc.IsNil)
962
962
        wc.AssertNoChange()
963
963
 
 
964
        // Add a nested container of the right type: not reported.
 
965
        params.ParentId = m.Id()
 
966
        params.ContainerType = instance.LXC
 
967
        c.Assert(err, gc.IsNil)
 
968
        wc.AssertNoChange()
 
969
 
964
970
        // Add a container of a different machine: not reported.
965
971
        params.ParentId = otherMachine.Id()
966
972
        params.ContainerType = instance.LXC
967
973
        m2, err := s.State.AddMachineWithConstraints(&params)
968
974
        c.Assert(err, gc.IsNil)
969
975
        wc.AssertNoChange()
 
976
        statetesting.AssertStop(c, w)
 
977
 
 
978
        w = machine.WatchContainers(instance.LXC)
 
979
        defer statetesting.AssertStop(c, w)
 
980
        wc = statetesting.NewStringsWatcherC(c, s.State, w)
 
981
        wc.AssertChange("0/lxc/0")
 
982
        wc.AssertNoChange()
970
983
 
971
984
        // Make the container Dying: reported.
972
985
        err = m.Destroy()