本文整理汇总了Golang中github.com/juju/juju/state.Living.Refresh方法的典型用法代码示例。如果您正苦于以下问题:Golang Living.Refresh方法的具体用法?Golang Living.Refresh怎么用?Golang Living.Refresh使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类github.com/juju/juju/state.Living
的用法示例。
在下文中一共展示了Living.Refresh方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: assertRemoved
func assertRemoved(c *gc.C, entity state.Living) {
err := entity.Refresh()
c.Assert(err, jc.Satisfies, errors.IsNotFound)
err = entity.Destroy()
c.Assert(err, jc.ErrorIsNil)
if entity, ok := entity.(state.AgentLiving); ok {
err = entity.EnsureDead()
c.Assert(err, jc.ErrorIsNil)
err = entity.Remove()
c.Assert(err, jc.ErrorIsNil)
}
}
示例2: prepareFixture
func (s *LifeSuite) prepareFixture(living state.Living, lfix lifeFixture, cached, dbinitial state.Life, c *gc.C) {
collName, id := lfix.id()
coll := s.MgoSuite.Session.DB("juju").C(collName)
err := coll.UpdateId(id, bson.D{{"$set", bson.D{
{"life", cached},
}}})
c.Assert(err, jc.ErrorIsNil)
err = living.Refresh()
c.Assert(err, jc.ErrorIsNil)
err = coll.UpdateId(id, bson.D{{"$set", bson.D{
{"life", dbinitial},
}}})
c.Assert(err, jc.ErrorIsNil)
}
示例3: assertLife
func assertLife(c *gc.C, entity state.Living, life state.Life) {
err := entity.Refresh()
c.Assert(err, jc.ErrorIsNil)
c.Assert(entity.Life(), gc.Equals, life)
}
示例4: assertLife
func assertLife(c *gc.C, entity state.Living, life state.Life) {
c.Assert(entity.Refresh(), gc.IsNil)
c.Assert(entity.Life(), gc.Equals, life)
}
示例5: assertRemoved
func assertRemoved(c *gc.C, entity state.Living) {
err := entity.Refresh()
c.Assert(err, jc.Satisfies, errors.IsNotFound)
}