func runAllCleanups(c *gc.C, st *state.State) { needCleanup, err := st.NeedsCleanup() c.Assert(err, jc.ErrorIsNil) for needCleanup { err := st.Cleanup() c.Assert(err, jc.ErrorIsNil) needCleanup, err = st.NeedsCleanup() c.Assert(err, jc.ErrorIsNil) } }
func assertCleanupRuns(c *gc.C, st *state.State) { err := st.Cleanup() c.Assert(err, jc.ErrorIsNil) }