Ejemplo n.º 1
0
func assertEnvHasBlock(c *gc.C, st *state.State, t state.BlockType, msg string) {
	dBlock, found, err := st.GetBlockForType(t)
	c.Assert(err, jc.ErrorIsNil)
	c.Assert(found, jc.IsTrue)
	c.Assert(dBlock, gc.NotNil)
	c.Assert(dBlock.Type(), gc.DeepEquals, t)
	tag, err := dBlock.Tag()
	c.Assert(err, jc.ErrorIsNil)
	c.Assert(tag, gc.DeepEquals, st.ModelTag())
	c.Assert(dBlock.Message(), gc.DeepEquals, msg)
}
Ejemplo n.º 2
0
func (s *blockSuite) assertModelHasBlock(c *gc.C, st *state.State, t state.BlockType, msg string) {
	block, found, err := st.GetBlockForType(t)
	c.Assert(err, jc.ErrorIsNil)
	c.Assert(found, jc.IsTrue)
	c.Assert(block, gc.NotNil)
	c.Assert(block.Type(), gc.Equals, t)
	tag, err := block.Tag()
	c.Assert(err, jc.ErrorIsNil)
	c.Assert(tag, gc.Equals, st.ModelTag())
	c.Assert(block.Message(), gc.Equals, msg)
}