gitlab-fog-azure-rm 1.4.0 → 1.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bce981ede9f77d01f6cfabd05f9b7bb77aff52a15ade7ac87ed441880178858f
|
4
|
+
data.tar.gz: e3b730ce6e3aa6ea507ab5352dbb0e3e56416abf5624fa763a4932e858efe649
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a9d42e20bed0c4b5c53757098ac751555c126dec547b19c133b7e130bba1c20ca1ca2b3cf1d4976391b0a06a66daaa268dba9a0b38eeb7a6258a187c78aa66e2
|
7
|
+
data.tar.gz: 88480526e3e2f0565fc3c24009a09bf482c721c9f14dacd39a5d2ecfdbfe909498a798ebbff8f7745df348c3f251fc69c20a1bcddff0090cd5e9becbe2a15378
|
data/CHANGELOG.md
CHANGED
@@ -0,0 +1,20 @@
|
|
1
|
+
module Fog
|
2
|
+
module Storage
|
3
|
+
class AzureRM
|
4
|
+
# This class provides the actual implementation for service calls.
|
5
|
+
class Real
|
6
|
+
def delete_object(container_name, blob_name)
|
7
|
+
delete_blob(container_name, blob_name)
|
8
|
+
end
|
9
|
+
end
|
10
|
+
|
11
|
+
# This class provides the mock implementation for unit tests.
|
12
|
+
class Mock
|
13
|
+
def delete_object(*)
|
14
|
+
Fog::Logger.debug 'Blob deleted successfully.'
|
15
|
+
true
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
data/lib/fog/azurerm/storage.rb
CHANGED
@@ -40,7 +40,6 @@ module Fog
|
|
40
40
|
request :compare_container_blobs
|
41
41
|
request :acquire_blob_lease
|
42
42
|
request :release_blob_lease
|
43
|
-
request :delete_blob
|
44
43
|
request :get_blob
|
45
44
|
request :get_blob_url
|
46
45
|
request :get_object_url
|
@@ -50,8 +49,10 @@ module Fog
|
|
50
49
|
request :put_blob_block
|
51
50
|
request :put_blob_https_url
|
52
51
|
request :put_object_url
|
52
|
+
request :delete_blob
|
53
53
|
request :delete_blob_https_url
|
54
54
|
request :delete_object_url
|
55
|
+
request :delete_object
|
55
56
|
request :commit_blob_blocks
|
56
57
|
request :create_page_blob
|
57
58
|
request :put_blob_pages
|
data/lib/fog/azurerm/version.rb
CHANGED
@@ -0,0 +1,42 @@
|
|
1
|
+
require File.expand_path '../../test_helper', __dir__
|
2
|
+
|
3
|
+
# Storage Blob Class
|
4
|
+
class TestDeleteObject < Minitest::Test
|
5
|
+
# This class posesses the test cases for the requests of deleting storage blobs.
|
6
|
+
def setup
|
7
|
+
Fog.mock!
|
8
|
+
@mock_service = Fog::Storage::AzureRM.new(storage_account_credentials)
|
9
|
+
Fog.unmock!
|
10
|
+
@mocked_response = mocked_storage_http_error
|
11
|
+
@mocked_not_found_response = mocked_storage_http_not_found_error
|
12
|
+
|
13
|
+
@service = Fog::Storage::AzureRM.new(storage_account_credentials)
|
14
|
+
@blob_client = @service.instance_variable_get(:@blob_client)
|
15
|
+
end
|
16
|
+
|
17
|
+
def test_delete_object_success
|
18
|
+
@blob_client.stub :delete_blob, true do
|
19
|
+
assert @service.delete_object('test_container', 'test_blob')
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
def test_delete_object_with_not_found_success
|
24
|
+
http_exception = ->(*) { raise Azure::Core::Http::HTTPError.new(@mocked_not_found_response) }
|
25
|
+
@blob_client.stub :delete_blob, http_exception do
|
26
|
+
assert @service.delete_object('test_container', 'test_blob')
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
def test_delete_object_http_exception
|
31
|
+
http_exception = ->(*) { raise Azure::Core::Http::HTTPError.new(@mocked_response) }
|
32
|
+
@blob_client.stub :delete_blob, http_exception do
|
33
|
+
assert_raises(Azure::Core::Http::HTTPError) do
|
34
|
+
@service.delete_object('test_container', 'test_blob')
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
def test_delete_object_mock
|
40
|
+
assert @mock_service.delete_blob('test_container', 'test_blob')
|
41
|
+
end
|
42
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gitlab-fog-azure-rm
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Shaffan Chaudhry
|
@@ -18,7 +18,7 @@ authors:
|
|
18
18
|
autorequire:
|
19
19
|
bindir: bin
|
20
20
|
cert_chain: []
|
21
|
-
date:
|
21
|
+
date: 2023-02-27 00:00:00.000000000 Z
|
22
22
|
dependencies:
|
23
23
|
- !ruby/object:Gem::Dependency
|
24
24
|
name: codeclimate-test-reporter
|
@@ -237,6 +237,7 @@ files:
|
|
237
237
|
- lib/fog/azurerm/requests/storage/delete_blob.rb
|
238
238
|
- lib/fog/azurerm/requests/storage/delete_blob_https_url.rb
|
239
239
|
- lib/fog/azurerm/requests/storage/delete_container.rb
|
240
|
+
- lib/fog/azurerm/requests/storage/delete_object.rb
|
240
241
|
- lib/fog/azurerm/requests/storage/delete_object_url.rb
|
241
242
|
- lib/fog/azurerm/requests/storage/get_blob.rb
|
242
243
|
- lib/fog/azurerm/requests/storage/get_blob_http_url.rb
|
@@ -294,6 +295,7 @@ files:
|
|
294
295
|
- test/requests/storage/test_delete_blob.rb
|
295
296
|
- test/requests/storage/test_delete_blob_https_url.rb
|
296
297
|
- test/requests/storage/test_delete_container.rb
|
298
|
+
- test/requests/storage/test_delete_object.rb
|
297
299
|
- test/requests/storage/test_get_blob.rb
|
298
300
|
- test/requests/storage/test_get_blob_http_url.rb
|
299
301
|
- test/requests/storage/test_get_blob_https_url.rb
|
@@ -338,7 +340,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
338
340
|
- !ruby/object:Gem::Version
|
339
341
|
version: '0'
|
340
342
|
requirements: []
|
341
|
-
rubygems_version: 3.
|
343
|
+
rubygems_version: 3.4.7
|
342
344
|
signing_key:
|
343
345
|
specification_version: 4
|
344
346
|
summary: Module for the 'fog' gem to support Azure Blob Storage with CarrierWave and
|