示例#1
0
文件: block_test.go 项目: makyo/juju
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)
}
示例#2
0
文件: block_test.go 项目: bac/juju
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)
}