本文整理汇总了Golang中gopkg/in/check/v1.C.SucceedNow方法的典型用法代码示例。如果您正苦于以下问题:Golang C.SucceedNow方法的具体用法?Golang C.SucceedNow怎么用?Golang C.SucceedNow使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类gopkg/in/check/v1.C
的用法示例。
在下文中一共展示了C.SucceedNow方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: TestGetEmptyArray
func (s *ArrayGroupSuite) TestGetEmptyArray(c *chk.C) {
res, err := arrayClient.GetEmpty()
if err != nil {
c.SucceedNow()
}
c.Assert(*res.Value, chk.DeepEquals, []int32{})
}
示例2: TestGetIntInvalidNull
// convert null to 0 - Int default value
// {1, null, 0} ---> {1,0,0}
func (s *ArrayGroupSuite) TestGetIntInvalidNull(c *chk.C) {
res, err := arrayClient.GetIntInvalidNull()
if err != nil {
c.SucceedNow()
}
c.Assert(*res.Value, chk.DeepEquals, []int32{1, 0, 0})
}
示例3: TestGetFloatInvalidNull
// convert null to 0 - Float default value
// {1, null, 0} ---> {1,0,0}
func (s *ArrayGroupSuite) TestGetFloatInvalidNull(c *chk.C) {
res, err := arrayClient.GetFloatInvalidNull()
if err != nil {
c.SucceedNow()
}
c.Assert(*res.Value, chk.DeepEquals, []float64{0, 0, -1.2e20})
}
示例4: TestGetInvalidDuration
func (s *DurationSuite) TestGetInvalidDuration(c *chk.C) {
res, err := durationClient.GetInvalid()
if err != nil {
c.SucceedNow()
}
_, err = time.ParseDuration(*res.Value)
c.Assert(err, chk.NotNil)
}
示例5: TestParseReference
func (s *PublishSuite) TestParseReference(c *gc.C) {
addMeta(c, s.branch, "")
cmd := &publishCommand{}
cmd.ChangePushLocation(func(location string) string {
c.Assert(location, gc.Equals, "lp:charms/precise/wordpress")
c.SucceedNow()
panic("unreachable")
})
_, err := testing.RunCommandInDir(c, modelcmd.Wrap(cmd), []string{"precise/wordpress"}, s.dir)
c.Assert(err, jc.ErrorIsNil)
c.Fatal("shouldn't get here; location closure didn't run?")
}
示例6: TestEnsureIndex
func (s *RootKeyStorageSuite) TestEnsureIndex(c *gc.C) {
keys := mgostorage.NewRootKeys(5)
err := keys.EnsureIndex(s.coll())
c.Assert(err, gc.IsNil)
// This code can take up to 60s to run; there's no way
// to force it to run more quickly, but it provides reassurance
// that the code actually works.
// Reenable the rest of this test if concerned about index behaviour.
c.SucceedNow()
_, id1, err := keys.NewStorage(s.coll(), mgostorage.Policy{
ExpiryDuration: 100 * time.Millisecond,
}).RootKey()
c.Assert(err, gc.IsNil)
_, id2, err := keys.NewStorage(s.coll(), mgostorage.Policy{
ExpiryDuration: time.Hour,
}).RootKey()
c.Assert(err, gc.IsNil)
c.Assert(id2, gc.Not(gc.Equals), id1)
// Sanity check that the keys are in the collection.
n, err := s.coll().Find(nil).Count()
c.Assert(err, gc.IsNil)
c.Assert(n, gc.Equals, 2)
for i := 0; i < 100; i++ {
n, err := s.coll().Find(nil).Count()
c.Assert(err, gc.IsNil)
switch n {
case 1:
c.SucceedNow()
case 2:
time.Sleep(time.Second)
default:
c.Fatalf("unexpected key count %v", n)
}
}
c.Fatalf("key was never removed from database")
}