gitlab-fog-azure-rm 1.6.0 → 1.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitlab-ci.yml +1 -1
- data/.rubocop.yml +1 -1
- data/CHANGELOG.md +5 -0
- data/gitlab-fog-azure-rm.gemspec +1 -1
- data/lib/fog/azurerm/requests/storage/get_object.rb +12 -2
- data/lib/fog/azurerm/version.rb +1 -1
- data/test/requests/storage/test_get_blob.rb +0 -15
- data/test/requests/storage/test_get_object.rb +34 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 96a2a16b2feac00c533b0489e6572ccd808c11e44f9f3efab5b69bdc392aea04
|
4
|
+
data.tar.gz: 8e7a5d519fa7002896efb7c00fe7bb73440f875cc0a428dba625695ed6c385bb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 36e3c183ee97204706d901c25c3791b760980d0dcf84440d2370dddff622f54670db85a11e1badec9853341e661d057d519b990912b626c9d86e16c9461e2ebf
|
7
|
+
data.tar.gz: b20976bdfab522b172572194e2f6f0693129c3f6315910fb9d8331cd11e9855ecce53292f22d982b7d6c7811267bce716cf6e680a04d3bf9e703988ee21b2f1e
|
data/.gitlab-ci.yml
CHANGED
data/.rubocop.yml
CHANGED
data/CHANGELOG.md
CHANGED
data/gitlab-fog-azure-rm.gemspec
CHANGED
@@ -15,7 +15,7 @@ Gem::Specification.new do |spec|
|
|
15
15
|
spec.homepage = 'https://gitlab.com/gitlab-org/gitlab-fog-azure-rm'
|
16
16
|
spec.rdoc_options = %w[--charset=UTF-8]
|
17
17
|
spec.extra_rdoc_files = %w[README.md]
|
18
|
-
spec.required_ruby_version = '>= 2.
|
18
|
+
spec.required_ruby_version = '>= 2.7.0'
|
19
19
|
spec.post_install_message = 'Thanks for installing!'
|
20
20
|
spec.add_development_dependency 'codeclimate-test-reporter' , '~> 1.0.0'
|
21
21
|
spec.add_development_dependency 'minitest', '~> 5.8.4'
|
@@ -3,12 +3,22 @@ module Fog
|
|
3
3
|
class AzureRM
|
4
4
|
# This class provides the actual implemention for service calls.
|
5
5
|
class Real
|
6
|
-
|
6
|
+
def get_object(...)
|
7
|
+
blob, body = get_blob(...)
|
8
|
+
|
9
|
+
blob[:body] = body
|
10
|
+
blob
|
11
|
+
end
|
7
12
|
end
|
8
13
|
|
9
14
|
# This class provides the mock implementation for unit tests.
|
10
15
|
class Mock
|
11
|
-
|
16
|
+
def get_object(...)
|
17
|
+
blob, body = get_blob(...)
|
18
|
+
|
19
|
+
blob[:body] = body
|
20
|
+
blob
|
21
|
+
end
|
12
22
|
end
|
13
23
|
end
|
14
24
|
end
|
data/lib/fog/azurerm/version.rb
CHANGED
@@ -26,12 +26,6 @@ class TestGetBlob < Minitest::Test
|
|
26
26
|
end
|
27
27
|
end
|
28
28
|
|
29
|
-
def test_get_object_success
|
30
|
-
@blob_client.stub :get_blob, @blob_with_content do
|
31
|
-
assert_equal @blob_with_content, @service.get_object('test_container', 'test_blob')
|
32
|
-
end
|
33
|
-
end
|
34
|
-
|
35
29
|
def test_get_blob_not_found
|
36
30
|
exception = ->(*) { raise StandardError.new('Not found(404). Not exist') }
|
37
31
|
@blob_client.stub :get_blob, exception do
|
@@ -41,15 +35,6 @@ class TestGetBlob < Minitest::Test
|
|
41
35
|
end
|
42
36
|
end
|
43
37
|
|
44
|
-
def test_get_object_not_found
|
45
|
-
exception = ->(*) { raise StandardError.new('Not found(404). Not exist') }
|
46
|
-
@blob_client.stub :get_blob, exception do
|
47
|
-
assert_raises('NotFound') do
|
48
|
-
@service.get_object('test_container', 'test_blob')
|
49
|
-
end
|
50
|
-
end
|
51
|
-
end
|
52
|
-
|
53
38
|
def test_get_blob_http_exception
|
54
39
|
http_exception = ->(*) { raise Azure::Core::Http::HTTPError.new(@mocked_response) }
|
55
40
|
@blob_client.stub :get_blob, http_exception do
|
@@ -0,0 +1,34 @@
|
|
1
|
+
require File.expand_path '../../test_helper', __dir__
|
2
|
+
|
3
|
+
# Storage Blob Class
|
4
|
+
class TestGetObject < Minitest::Test
|
5
|
+
# This class posesses the test cases for the requests of getting storage blob.
|
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
|
+
|
12
|
+
@service = Fog::Storage::AzureRM.new(storage_account_credentials)
|
13
|
+
@blob_client = @service.instance_variable_get(:@blob_client)
|
14
|
+
|
15
|
+
@raw_cloud_blob = storage_blob
|
16
|
+
@blob = ApiStub::Requests::Storage::File.blob_as_hash
|
17
|
+
@blob_with_content = @blob.merge(body: 'content')
|
18
|
+
end
|
19
|
+
|
20
|
+
def test_get_object_success
|
21
|
+
@blob_client.stub :get_blob, @blob_with_content do
|
22
|
+
assert_equal @blob_with_content, @service.get_object('test_container', 'test_blob')
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
def test_get_object_not_found
|
27
|
+
exception = ->(*) { raise StandardError.new('Not found(404). Not exist') }
|
28
|
+
@blob_client.stub :get_blob, exception do
|
29
|
+
assert_raises('NotFound') do
|
30
|
+
@service.get_object('test_container', 'test_blob')
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
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.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Shaffan Chaudhry
|
@@ -305,6 +305,7 @@ files:
|
|
305
305
|
- test/requests/storage/test_get_container_acl.rb
|
306
306
|
- test/requests/storage/test_get_container_properties.rb
|
307
307
|
- test/requests/storage/test_get_container_url.rb
|
308
|
+
- test/requests/storage/test_get_object.rb
|
308
309
|
- test/requests/storage/test_list_blobs.rb
|
309
310
|
- test/requests/storage/test_list_containers.rb
|
310
311
|
- test/requests/storage/test_put_blob_block.rb
|
@@ -334,7 +335,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
334
335
|
requirements:
|
335
336
|
- - ">="
|
336
337
|
- !ruby/object:Gem::Version
|
337
|
-
version: 2.
|
338
|
+
version: 2.7.0
|
338
339
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
339
340
|
requirements:
|
340
341
|
- - ">="
|