本文整理汇总了Golang中github.com/Azure/azure-sdk-for-go/Godeps/_workspace/src/gopkg/in/check/v1.C.Check方法的典型用法代码示例。如果您正苦于以下问题:Golang C.Check方法的具体用法?Golang C.Check怎么用?Golang C.Check使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类github.com/Azure/azure-sdk-for-go/Godeps/_workspace/src/gopkg/in/check/v1.C
的用法示例。
在下文中一共展示了C.Check方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: TestReturnsStorageServiceError
func (s *StorageClientSuite) TestReturnsStorageServiceError(c *chk.C) {
// attempt to delete a nonexisting container
_, err := getBlobClient(c).deleteContainer(randContainer())
c.Assert(err, chk.NotNil)
v, ok := err.(AzureStorageServiceError)
c.Check(ok, chk.Equals, true)
c.Assert(v.StatusCode, chk.Equals, 404)
c.Assert(v.Code, chk.Equals, "ContainerNotFound")
c.Assert(v.Code, chk.Not(chk.Equals), "")
}
示例2: TestGetAndSetMetadata
func (s *StorageBlobSuite) TestGetAndSetMetadata(c *chk.C) {
cli := getBlobClient(c)
cnt := randContainer()
c.Assert(cli.CreateContainer(cnt, ContainerAccessTypePrivate), chk.IsNil)
defer cli.deleteContainer(cnt)
blob := randString(20)
c.Assert(cli.putSingleBlockBlob(cnt, blob, []byte{}), chk.IsNil)
m, err := cli.GetBlobMetadata(cnt, blob)
c.Assert(err, chk.IsNil)
c.Assert(m, chk.Not(chk.Equals), nil)
c.Assert(len(m), chk.Equals, 0)
mPut := map[string]string{
"foo": "bar",
"bar_baz": "waz qux",
}
err = cli.SetBlobMetadata(cnt, blob, mPut)
c.Assert(err, chk.IsNil)
m, err = cli.GetBlobMetadata(cnt, blob)
c.Assert(err, chk.IsNil)
c.Check(m, chk.DeepEquals, mPut)
// Case munging
mPutUpper := map[string]string{
"Foo": "different bar",
"bar_BAZ": "different waz qux",
}
mExpectLower := map[string]string{
"foo": "different bar",
"bar_baz": "different waz qux",
}
err = cli.SetBlobMetadata(cnt, blob, mPutUpper)
c.Assert(err, chk.IsNil)
m, err = cli.GetBlobMetadata(cnt, blob)
c.Assert(err, chk.IsNil)
c.Check(m, chk.DeepEquals, mExpectLower)
}