本文整理匯總了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)
}