Debian Codegraph @

storage/2020-08-04/blob/containers/lifecycle_test.go

raw symbols ◀ ▶ SCIP
1 Debian patch touch this file
1 package containersscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/blob/containers`/
2
3 import (
4 "contextscip-go gomod github.com/golang/go/src go1.13 context/"
5 "fmtscip-go gomod github.com/golang/go/src go1.13 fmt/"
6 "testingscip-go gomod github.com/golang/go/src go1.13 testing/"
7 "timescip-go gomod github.com/golang/go/src go1.13 time/"
8
9 "github.com/Azure/azure-sdk-for-go/profiles/latest/storage/mgmt/storagescip-go gomod github.com/Azure/azure-sdk-for-go v68.0.0 `github.com/Azure/azure-sdk-for-go/profiles/latest/storage/mgmt/storage`/"
10 "github.com/tombuildsstuff/giovanni/storage/internal/authscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/internal/auth`/"
11 "github.com/tombuildsstuff/giovanni/testhelpersscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/testhelpers`/"
12 )
13
14 var _ StorageContainerscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/blob/containers`/StorageContainer# = Clientscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/blob/containers`/Client#{}
15
16 func TestContainerLifecyclescip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/blob/containers`/TestContainerLifecycle().(t *testingscip-go gomod github.com/golang/go/src go1.13 testing/.Tscip-go gomod github.com/golang/go/src go1.13 testing/T#) {
17 client, err := testhelpersscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/testhelpers`/.Buildscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/testhelpers`/Build().(t)
18 if err != nil {
19 t.Fatalscip-go gomod github.com/golang/go/src go1.13 testing/common#Fatal().(err)
20 }
21 ctx := contextscip-go gomod github.com/golang/go/src go1.13 context/.TODOscip-go gomod github.com/golang/go/src go1.13 context/TODO().()
22
23 resourceGroup := fmtscip-go gomod github.com/golang/go/src go1.13 fmt/.Sprintfscip-go gomod github.com/golang/go/src go1.13 fmt/Sprintf().("acctestrg-%d", testhelpersscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/testhelpers`/.RandomIntscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/testhelpers`/RandomInt().())
24 accountName := fmtscip-go gomod github.com/golang/go/src go1.13 fmt/.Sprintfscip-go gomod github.com/golang/go/src go1.13 fmt/Sprintf().("acctestsa%s", testhelpersscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/testhelpers`/.RandomStringscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/testhelpers`/RandomString().())
25 containerName := fmtscip-go gomod github.com/golang/go/src go1.13 fmt/.Sprintfscip-go gomod github.com/golang/go/src go1.13 fmt/Sprintf().("cont-%d", testhelpersscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/testhelpers`/.RandomIntscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/testhelpers`/RandomInt().())
26
•27 testData, err := client.BuildTestResourcesscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/testhelpers`/Client#BuildTestResources().(ctx, resourceGroup, accountName, storagescip-go gomod github.com/Azure/azure-sdk-for-go v68.0.0 `github.com/Azure/azure-sdk-for-go/profiles/latest/storage/mgmt/storage`/.BlobStoragescip-go gomod github.com/Azure/azure-sdk-for-go v68.0.0 `github.com/Azure/azure-sdk-for-go/profiles/latest/storage/mgmt/storage`/BlobStorage.)
28 if err != nil {
29 t.Fatalscip-go gomod github.com/golang/go/src go1.13 testing/common#Fatal().(err)
30 }
31 defer client.DestroyTestResourcesscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/testhelpers`/Client#DestroyTestResources().(ctx, resourceGroup, accountName)
32
33 storageAuth := authscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/internal/auth`/.NewSharedKeyLiteAuthorizerscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/internal/auth`/NewSharedKeyLiteAuthorizer().(accountName, testData.StorageAccountKeyscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/testhelpers`/TestResources#StorageAccountKey.)
34 containersClient := NewWithEnvironmentscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/blob/containers`/NewWithEnvironment().(client.Environmentscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/testhelpers`/Client#Environment.)
35 containersClient.Clientscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/blob/containers`/Client#Client. = client.PrepareWithAuthorizerscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/testhelpers`/Client#PrepareWithAuthorizer().(containersClient.Clientscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/blob/containers`/Client#Client., storageAuth)
36
37 // first let's test an empty container
38 input := CreateInputscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/blob/containers`/CreateInput#{}
39 _, err = containersClient.Createscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/blob/containers`/Client#Create().(ctx, accountName, containerName, input)
40 if err != nil {
41 t.Fatalscip-go gomod github.com/golang/go/src go1.13 testing/common#Fatal().(fmtscip-go gomod github.com/golang/go/src go1.13 fmt/.Errorfscip-go gomod github.com/golang/go/src go1.13 fmt/Errorf().("Error creating: %s", err))
42 }
43
44 container, err := containersClient.GetPropertiesscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/blob/containers`/Client#GetProperties().(ctx, accountName, containerName)
45 if err != nil {
46 t.Fatalscip-go gomod github.com/golang/go/src go1.13 testing/common#Fatal().(fmtscip-go gomod github.com/golang/go/src go1.13 fmt/.Errorfscip-go gomod github.com/golang/go/src go1.13 fmt/Errorf().("Error retrieving: %s", err))
47 }
48
49 if container.AccessLevelscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/blob/containers`/ContainerProperties#AccessLevel. != Privatescip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/blob/containers`/Private. {
50 t.Fatalfscip-go gomod github.com/golang/go/src go1.13 testing/common#Fatalf().("Expected Access Level to be Private but got %q", container.AccessLevelscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/blob/containers`/ContainerProperties#AccessLevel.)
51 }
52 if len(container.MetaDatascip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/blob/containers`/ContainerProperties#MetaData.) != 0 {
53 t.Fatalfscip-go gomod github.com/golang/go/src go1.13 testing/common#Fatalf().("Expected MetaData to be empty but got: %s", container.MetaDatascip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/blob/containers`/ContainerProperties#MetaData.)
54 }
55 if container.LeaseStatusscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/blob/containers`/ContainerProperties#LeaseStatus. != Unlockedscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/blob/containers`/Unlocked. {
56 t.Fatalfscip-go gomod github.com/golang/go/src go1.13 testing/common#Fatalf().("Expected Container Lease to be Unlocked but was: %s", container.LeaseStatusscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/blob/containers`/ContainerProperties#LeaseStatus.)
57 }
58
59 // then update the metadata
60 metaData := map[string]string{
61 "dont": "kill-my-vibe",
62 }
63 _, err = containersClient.SetMetaDatascip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/blob/containers`/Client#SetMetaData().(ctx, accountName, containerName, metaData)
64 if err != nil {
65 t.Fatalscip-go gomod github.com/golang/go/src go1.13 testing/common#Fatal().(fmtscip-go gomod github.com/golang/go/src go1.13 fmt/.Errorfscip-go gomod github.com/golang/go/src go1.13 fmt/Errorf().("Error updating metadata: %s", err))
66 }
67
68 // give azure time to replicate
69 timescip-go gomod github.com/golang/go/src go1.13 time/.Sleepscip-go gomod github.com/golang/go/src go1.13 time/Sleep().(2 * timescip-go gomod github.com/golang/go/src go1.13 time/.Secondscip-go gomod github.com/golang/go/src go1.13 time/Second.)
70
71 // then assert that
72 container, err = containersClient.GetPropertiesscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/blob/containers`/Client#GetProperties().(ctx, accountName, containerName)
73 if err != nil {
74 t.Fatalscip-go gomod github.com/golang/go/src go1.13 testing/common#Fatal().(fmtscip-go gomod github.com/golang/go/src go1.13 fmt/.Errorfscip-go gomod github.com/golang/go/src go1.13 fmt/Errorf().("Error re-retrieving: %s", err))
75 }
76 if len(container.MetaDatascip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/blob/containers`/ContainerProperties#MetaData.) != 1 {
77 t.Fatalfscip-go gomod github.com/golang/go/src go1.13 testing/common#Fatalf().("Expected 1 item in the metadata but got: %s", container.MetaDatascip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/blob/containers`/ContainerProperties#MetaData.)
78 }
79 if container.MetaDatascip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/blob/containers`/ContainerProperties#MetaData.["dont"] != "kill-my-vibe" {
80 t.Fatalfscip-go gomod github.com/golang/go/src go1.13 testing/common#Fatalf().("Expected `kill-my-vibe` but got %q", container.MetaDatascip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/blob/containers`/ContainerProperties#MetaData.["dont"])
81 }
82 if container.AccessLevelscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/blob/containers`/ContainerProperties#AccessLevel. != Privatescip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/blob/containers`/Private. {
83 t.Fatalfscip-go gomod github.com/golang/go/src go1.13 testing/common#Fatalf().("Expected Access Level to be Private but got %q", container.AccessLevelscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/blob/containers`/ContainerProperties#AccessLevel.)
84 }
85 if container.LeaseStatusscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/blob/containers`/ContainerProperties#LeaseStatus. != Unlockedscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/blob/containers`/Unlocked. {
86 t.Fatalfscip-go gomod github.com/golang/go/src go1.13 testing/common#Fatalf().("Expected Container Lease to be Unlocked but was: %s", container.LeaseStatusscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/blob/containers`/ContainerProperties#LeaseStatus.)
87 }
88
89 // then update the ACL
90 _, err = containersClient.SetAccessControlscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/blob/containers`/Client#SetAccessControl().(ctx, accountName, containerName, Blobscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/blob/containers`/Blob.)
91 if err != nil {
92 t.Fatalscip-go gomod github.com/golang/go/src go1.13 testing/common#Fatal().(fmtscip-go gomod github.com/golang/go/src go1.13 fmt/.Errorfscip-go gomod github.com/golang/go/src go1.13 fmt/Errorf().("Error updating ACL's: %s", err))
93 }
94
95 // give azure some time to replicate
96 timescip-go gomod github.com/golang/go/src go1.13 time/.Sleepscip-go gomod github.com/golang/go/src go1.13 time/Sleep().(2 * timescip-go gomod github.com/golang/go/src go1.13 time/.Secondscip-go gomod github.com/golang/go/src go1.13 time/Second.)
97
98 // then assert that
99 container, err = containersClient.GetPropertiesscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/blob/containers`/Client#GetProperties().(ctx, accountName, containerName)
100 if err != nil {
101 t.Fatalscip-go gomod github.com/golang/go/src go1.13 testing/common#Fatal().(fmtscip-go gomod github.com/golang/go/src go1.13 fmt/.Errorfscip-go gomod github.com/golang/go/src go1.13 fmt/Errorf().("Error re-retrieving: %s", err))
102 }
103 if container.AccessLevelscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/blob/containers`/ContainerProperties#AccessLevel. != Blobscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/blob/containers`/Blob. {
104 t.Fatalfscip-go gomod github.com/golang/go/src go1.13 testing/common#Fatalf().("Expected Access Level to be Blob but got %q", container.AccessLevelscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/blob/containers`/ContainerProperties#AccessLevel.)
105 }
106 if len(container.MetaDatascip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/blob/containers`/ContainerProperties#MetaData.) != 1 {
107 t.Fatalfscip-go gomod github.com/golang/go/src go1.13 testing/common#Fatalf().("Expected 1 item in the metadata but got: %s", container.MetaDatascip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/blob/containers`/ContainerProperties#MetaData.)
108 }
109 if container.LeaseStatusscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/blob/containers`/ContainerProperties#LeaseStatus. != Unlockedscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/blob/containers`/Unlocked. {
110 t.Fatalfscip-go gomod github.com/golang/go/src go1.13 testing/common#Fatalf().("Expected Container Lease to be Unlocked but was: %s", container.LeaseStatusscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/blob/containers`/ContainerProperties#LeaseStatus.)
111 }
112
113 // acquire a lease for 30s
114 acquireLeaseInput := AcquireLeaseInputscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/blob/containers`/AcquireLeaseInput#{
115 LeaseDurationscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/blob/containers`/AcquireLeaseInput#LeaseDuration.: 30,
116 }
117 acquireLeaseResp, err := containersClient.AcquireLeasescip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/blob/containers`/Client#AcquireLease().(ctx, accountName, containerName, acquireLeaseInput)
118 if err != nil {
119 t.Fatalfscip-go gomod github.com/golang/go/src go1.13 testing/common#Fatalf().("Error acquiring lease: %s", err)
120 }
121 t.Logfscip-go gomod github.com/golang/go/src go1.13 testing/common#Logf().("[DEBUG] Lease ID: %s", acquireLeaseResp.LeaseIDscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/blob/containers`/AcquireLeaseResponse#LeaseID.)
122
123 // we should then be able to update the ID
124 t.Logfscip-go gomod github.com/golang/go/src go1.13 testing/common#Logf().("[DEBUG] Changing lease..")
125 updateLeaseInput := ChangeLeaseInputscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/blob/containers`/ChangeLeaseInput#{
126 ExistingLeaseIDscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/blob/containers`/ChangeLeaseInput#ExistingLeaseID.: acquireLeaseResp.LeaseIDscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/blob/containers`/AcquireLeaseResponse#LeaseID.,
127 ProposedLeaseIDscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/blob/containers`/ChangeLeaseInput#ProposedLeaseID.: "aaaabbbb-aaaa-bbbb-cccc-aaaabbbbcccc",
128 }
129 updateLeaseResp, err := containersClient.ChangeLeasescip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/blob/containers`/Client#ChangeLease().(ctx, accountName, containerName, updateLeaseInput)
130 if err != nil {
131 t.Fatalfscip-go gomod github.com/golang/go/src go1.13 testing/common#Fatalf().("Error changing lease: %s", err)
132 }
133
134 // then renew it
135 _, err = containersClient.RenewLeasescip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/blob/containers`/Client#RenewLease().(ctx, accountName, containerName, updateLeaseResp.LeaseIDscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/blob/containers`/ChangeLeaseResponse#LeaseID.)
136 if err != nil {
137 t.Fatalfscip-go gomod github.com/golang/go/src go1.13 testing/common#Fatalf().("Error renewing lease: %s", err)
138 }
139
140 // and then give it a timeout
141 breakPeriod := 20
142 breakLeaseInput := BreakLeaseInputscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/blob/containers`/BreakLeaseInput#{
143 LeaseIDscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/blob/containers`/BreakLeaseInput#LeaseID.: updateLeaseResp.LeaseIDscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/blob/containers`/ChangeLeaseResponse#LeaseID.,
144 BreakPeriodscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/blob/containers`/BreakLeaseInput#BreakPeriod.: &breakPeriod,
145 }
146 breakLeaseResp, err := containersClient.BreakLeasescip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/blob/containers`/Client#BreakLease().(ctx, accountName, containerName, breakLeaseInput)
147 if err != nil {
148 t.Fatalfscip-go gomod github.com/golang/go/src go1.13 testing/common#Fatalf().("Error breaking lease: %s", err)
149 }
150 if breakLeaseResp.LeaseTimescip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/blob/containers`/BreakLeaseResponse#LeaseTime. == 0 {
151 t.Fatalfscip-go gomod github.com/golang/go/src go1.13 testing/common#Fatalf().("Lease broke immediately when should have waited: %d", breakLeaseResp.LeaseTimescip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/blob/containers`/BreakLeaseResponse#LeaseTime.)
152 }
153
154 // and finally ditch it
155 _, err = containersClient.ReleaseLeasescip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/blob/containers`/Client#ReleaseLease().(ctx, accountName, containerName, updateLeaseResp.LeaseIDscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/blob/containers`/ChangeLeaseResponse#LeaseID.)
156 if err != nil {
157 t.Fatalfscip-go gomod github.com/golang/go/src go1.13 testing/common#Fatalf().("Error releasing lease: %s", err)
158 }
159
160 t.Logfscip-go gomod github.com/golang/go/src go1.13 testing/common#Logf().("[DEBUG] Listing blobs in the container..")
161 listInput := ListBlobsInputscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/blob/containers`/ListBlobsInput#{}
162 listResult, err := containersClient.ListBlobsscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/blob/containers`/Client#ListBlobs().(ctx, accountName, containerName, listInput)
163 if err != nil {
164 t.Fatalfscip-go gomod github.com/golang/go/src go1.13 testing/common#Fatalf().("Error listing blobs: %s", err)
165 }
166
167 if len(listResult.Blobsscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/blob/containers`/ListBlobsResult#Blobs..Blobsscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/blob/containers`/Blobs#Blobs.) != 0 {
168 t.Fatalfscip-go gomod github.com/golang/go/src go1.13 testing/common#Fatalf().("Expected there to be no blobs in the container but got %d", len(listResult.Blobsscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/blob/containers`/ListBlobsResult#Blobs..Blobsscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/blob/containers`/Blobs#Blobs.))
169 }
170
171 t.Logfscip-go gomod github.com/golang/go/src go1.13 testing/common#Logf().("[DEBUG] Deleting..")
172 _, err = containersClient.Deletescip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/blob/containers`/Client#Delete().(ctx, accountName, containerName)
173 if err != nil {
174 t.Fatalscip-go gomod github.com/golang/go/src go1.13 testing/common#Fatal().(fmtscip-go gomod github.com/golang/go/src go1.13 fmt/.Errorfscip-go gomod github.com/golang/go/src go1.13 fmt/Errorf().("Error deleting: %s", err))
175 }
176 }