Lines Matching refs:chk

15 	chk "gopkg.in/check.v1"  packageName
20 var _ = chk.Suite(&StorageBlobSuite{})
22 func getBlobClient(c *chk.C) BlobStorageClient {
26 func (s *StorageBlobSuite) Test_buildPath(c *chk.C) {
30 c.Assert(b.buildPath(), chk.Equals, "/lol/rofl")
33 func (s *StorageBlobSuite) Test_pathForResource(c *chk.C) {
34 c.Assert(pathForResource("lol", ""), chk.Equals, "/lol")
35 c.Assert(pathForResource("lol", "blob"), chk.Equals, "/lol/blob")
38 func (s *StorageBlobSuite) TestBlobExists(c *chk.C) {
44 c.Assert(cnt.Create(nil), chk.IsNil)
48 c.Assert(b.putSingleBlockBlob([]byte("Hello!")), chk.IsNil)
52 c.Assert(err, chk.IsNil)
53 c.Assert(ok, chk.Equals, true)
56 c.Assert(err, chk.IsNil)
57 c.Assert(ok, chk.Equals, false)
61 func (s *StorageBlobSuite) TestGetBlobURL(c *chk.C) {
63 c.Assert(err, chk.IsNil)
68 c.Assert(b.GetURL(), chk.Equals, "https://golangrocksonazure.blob.core.windows.net/c/nested/blob")
71 …c.Assert(b.GetURL(), chk.Equals, "https://golangrocksonazure.blob.core.windows.net/$root/nested/bl…
74 c.Assert(b.GetURL(), chk.Equals, "https://golangrocksonazure.blob.core.windows.net/$root/blob")
78 func (s *StorageBlobSuite) TestGetBlobContainerURL(c *chk.C) {
80 c.Assert(err, chk.IsNil)
85 c.Assert(b.GetURL(), chk.Equals, "https://golangrocksonazure.blob.core.windows.net/c")
88 c.Assert(b.GetURL(), chk.Equals, "https://golangrocksonazure.blob.core.windows.net/$root")
91 func (s *StorageBlobSuite) TestDeleteBlobIfExists(c *chk.C) {
98 c.Assert(cnt.Create(nil), chk.IsNil)
101 c.Assert(b.Delete(nil), chk.NotNil)
104 c.Assert(err, chk.IsNil)
105 c.Assert(ok, chk.Equals, false)
108 func (s *StorageBlobSuite) TestDeleteBlobWithConditions(c *chk.C) {
115 c.Assert(cnt.Create(nil), chk.IsNil)
118 c.Assert(b.CreateBlockBlob(nil), chk.IsNil)
120 c.Assert(err, chk.IsNil)
128 c.Assert(err, chk.FitsTypeOf, AzureStorageServiceError{})
129 c.Assert(err.(AzureStorageServiceError).StatusCode, chk.Equals, http.StatusPreconditionFailed)
131 c.Assert(err, chk.IsNil)
132 c.Assert(ok, chk.Equals, true)
137 c.Assert(err, chk.IsNil)
138 c.Assert(ok, chk.Equals, true)
141 func (s *StorageBlobSuite) TestGetBlobProperties(c *chk.C) {
147 c.Assert(cnt.Create(nil), chk.IsNil)
153 c.Assert(err, chk.NotNil)
158 c.Assert(blob2.putSingleBlockBlob(contents), chk.IsNil)
162 c.Assert(err, chk.IsNil)
164 c.Assert(blob2.Properties.ContentLength, chk.Equals, int64(len(contents)))
165 c.Assert(blob2.Properties.ContentType, chk.Equals, "application/octet-stream")
166 c.Assert(blob2.Properties.BlobType, chk.Equals, BlobTypeBlock)
171 func (s *StorageBlobSuite) TestMarshalBlobMetadata(c *chk.C) {
179 c.Assert(err, chk.IsNil)
180 c.Assert(string(buf), chk.Matches, `.*<Metadata><Lol>baz &lt; waz</Lol></Metadata>.*`)
183 func (s *StorageBlobSuite) TestGetAndSetBlobMetadata(c *chk.C) {
189 c.Assert(cnt.Create(nil), chk.IsNil)
194 c.Assert(blob1.putSingleBlockBlob([]byte("Hello!")), chk.IsNil)
197 c.Assert(err, chk.IsNil)
198 c.Assert(blob1.Metadata, chk.HasLen, 0)
202 c.Assert(blob2.putSingleBlockBlob([]byte("Hello!")), chk.IsNil)
210 c.Assert(err, chk.IsNil)
213 c.Assert(err, chk.IsNil)
214 c.Check(blob2.Metadata, chk.DeepEquals, metaPut)
217 func (s *StorageBlobSuite) TestMetadataCaseMunging(c *chk.C) {
223 c.Assert(cnt.Create(nil), chk.IsNil)
227 c.Assert(b.putSingleBlockBlob([]byte("Hello!")), chk.IsNil)
241 c.Assert(err, chk.IsNil)
244 c.Assert(err, chk.IsNil)
245 c.Check(b.Metadata, chk.DeepEquals, metaExpectLower)
248 func (s *StorageBlobSuite) TestSetMetadataWithExtraHeaders(c *chk.C) {
255 c.Assert(cnt.Create(nil), chk.IsNil)
258 c.Assert(b.putSingleBlockBlob([]byte("Hello!")), chk.IsNil)
272 c.Assert(err, chk.NotNil)
275 c.Assert(err, chk.IsNil)
281 c.Assert(err, chk.IsNil)
284 func (s *StorageBlobSuite) TestSetBlobProperties(c *chk.C) {
291 c.Assert(cnt.Create(nil), chk.IsNil)
294 c.Assert(b.putSingleBlockBlob([]byte("Hello!")), chk.IsNil)
306 c.Assert(err, chk.IsNil)
309 c.Assert(err, chk.IsNil)
311 c.Check(b.Properties.CacheControl, chk.Equals, input.CacheControl)
312 c.Check(b.Properties.ContentType, chk.Equals, input.ContentType)
313 c.Check(b.Properties.ContentMD5, chk.Equals, input.ContentMD5)
314 c.Check(b.Properties.ContentEncoding, chk.Equals, input.ContentEncoding)
315 c.Check(b.Properties.ContentLanguage, chk.Equals, input.ContentLanguage)
318 func (s *StorageBlobSuite) TestSetPageBlobProperties(c *chk.C) {
325 c.Assert(cnt.Create(nil), chk.IsNil)
330 c.Assert(b.PutPageBlob(nil), chk.IsNil)
335 c.Assert(err, chk.IsNil)
338 func (s *StorageBlobSuite) TestSnapshotBlob(c *chk.C) {
345 c.Assert(cnt.Create(nil), chk.IsNil)
348 c.Assert(b.putSingleBlockBlob([]byte("Hello!")), chk.IsNil)
351 c.Assert(err, chk.IsNil)
352 c.Assert(snapshotTime, chk.NotNil)
355 func (s *StorageBlobSuite) TestSnapshotBlobWithTimeout(c *chk.C) {
362 c.Assert(cnt.Create(nil), chk.IsNil)
365 c.Assert(b.putSingleBlockBlob([]byte("Hello!")), chk.IsNil)
371 c.Assert(err, chk.IsNil)
372 c.Assert(snapshotTime, chk.NotNil)
375 func (s *StorageBlobSuite) TestSnapshotBlobWithValidLease(c *chk.C) {
382 c.Assert(cnt.Create(nil), chk.IsNil)
385 c.Assert(b.putSingleBlockBlob([]byte("Hello!")), chk.IsNil)
389 c.Assert(err, chk.IsNil)
395 c.Assert(err, chk.IsNil)
396 c.Assert(snapshotTime, chk.NotNil)
399 func (s *StorageBlobSuite) TestSnapshotBlobWithInvalidLease(c *chk.C) {
406 c.Assert(cnt.Create(nil), chk.IsNil)
409 c.Assert(b.putSingleBlockBlob([]byte("Hello!")), chk.IsNil)
413 c.Assert(err, chk.IsNil)
414 c.Assert(leaseID, chk.Not(chk.Equals), "")
420 c.Assert(err, chk.NotNil)
421 c.Assert(snapshotTime, chk.IsNil)
424 func (s *StorageBlobSuite) TestGetBlobRange(c *chk.C) {
431 c.Assert(cnt.Create(nil), chk.IsNil)
435 c.Assert(b.putSingleBlockBlob([]byte(body)), chk.IsNil)
490 c.Assert(err, chk.IsNil)
495 c.Assert(err, chk.IsNil)
497 c.Assert(err, chk.IsNil)
500 c.Assert(str, chk.Equals, r.expected)
503 c.Assert(b.Properties.ContentLength, chk.Equals, int64(len(body)))
525 func blobName(c *chk.C, extras ...string) string {
535 func nameGenerator(maxLen int, prefix, valid string, c *chk.C, extras []string) string {