gitlab-fog-azure-rm 1.4.0 → 1.5.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 26308fac90191e41fa3a0cfe59f7c02159c5ac5c846c2fc958038d1fbaa9bf34
4
- data.tar.gz: 9b382c3381a912f1c847c7757576f467750d9fedfb08304fa47e663fb7f34ad0
3
+ metadata.gz: bce981ede9f77d01f6cfabd05f9b7bb77aff52a15ade7ac87ed441880178858f
4
+ data.tar.gz: e3b730ce6e3aa6ea507ab5352dbb0e3e56416abf5624fa763a4932e858efe649
5
5
  SHA512:
6
- metadata.gz: f54b5e063064523fbb79ea1aea50ad6847a20c9ffc47a81ae95d1869d2c487b75b8205b567e7d9cf08d10ac1b0c083661003aef4df3762f81382805d2e950c02
7
- data.tar.gz: fa98f14295c821d0d07321adc42080163fc774684a0f8e87611a1921b4a22cbd20d68e3938177840b12f2b96e30d377addd379841161657d704343602de8fcb4
6
+ metadata.gz: a9d42e20bed0c4b5c53757098ac751555c126dec547b19c133b7e130bba1c20ca1ca2b3cf1d4976391b0a06a66daaa268dba9a0b38eeb7a6258a187c78aa66e2
7
+ data.tar.gz: 88480526e3e2f0565fc3c24009a09bf482c721c9f14dacd39a5d2ecfdbfe909498a798ebbff8f7745df348c3f251fc69c20a1bcddff0090cd5e9becbe2a15378
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  ## Unreleased
2
2
 
3
+ ## 1.5.0
4
+
5
+ - Add delete_object request method !32
6
+
3
7
  ## 1.4.0
4
8
 
5
9
  - Move all top-level constants and functions to Fog::AzureRM !30
@@ -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
@@ -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
@@ -1,5 +1,5 @@
1
1
  module Fog
2
2
  module AzureRM
3
- VERSION = '1.4.0'.freeze
3
+ VERSION = '1.5.0'.freeze
4
4
  end
5
5
  end
@@ -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.0
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: 2022-11-07 00:00:00.000000000 Z
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.2.22
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