fog-azure-rm 0.4.8 → 0.4.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +6 -4
- data/CHANGELOG.md +12 -0
- data/README.md +2 -0
- data/lib/fog/azurerm/docs/compute.md +2 -0
- data/lib/fog/azurerm/models/compute/managed_disk.rb +9 -2
- data/lib/fog/azurerm/requests/compute/delete_managed_disk.rb +12 -4
- data/lib/fog/azurerm/requests/network/list_network_security_groups.rb +139 -143
- data/lib/fog/azurerm/requests/storage/get_blob_properties.rb +26 -26
- data/lib/fog/azurerm/storage.rb +1 -0
- data/lib/fog/azurerm/version.rb +1 -1
- data/test/api_stub/requests/network/network_security_group.rb +2 -2
- data/test/api_stub/requests/storage/file.rb +9 -0
- data/test/models/compute/test_managed_disk.rb +9 -2
- data/test/requests/compute/test_delete_managed_disk.rb +2 -2
- data/test/requests/network/test_list_network_security_groups.rb +3 -3
- data/test/requests/storage/test_get_blob.rb +1 -1
- data/test/requests/storage/test_get_blob_properties.rb +3 -1
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b6eace092703425619fcb56d16c63043e2f92be194dbe41d800702afb6f03238
|
4
|
+
data.tar.gz: dbeacbf137a189c567e97e2c6b459b6d6e4fc5edde87a7d1a674c48059e7d975
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e18b3f6b29b0e8ebe819650977bd7bc06a37efab2191ef1bbc07761e22dad7ebe651b4b6eb282ef5146d4e388cb8183511e8e0ae0a87bcfde8f232b16d485d70
|
7
|
+
data.tar.gz: b746e050e5e78944ed72644b23c506bbd0e5d7f71830d6207bcf54d9f59c5d48e45fd8334bdf40ce3514894cde942fd2b2625db4ae280fd31a7a7e47e7ccd04f
|
data/.travis.yml
CHANGED
@@ -2,8 +2,8 @@ language: ruby
|
|
2
2
|
sudo: false
|
3
3
|
|
4
4
|
before_install:
|
5
|
-
- gem
|
6
|
-
- gem
|
5
|
+
- gem uninstall -v '>= 2' -i $(rvm gemdir)@global -ax bundler || true
|
6
|
+
- gem install bundler -v '< 2'
|
7
7
|
- gem uninstall -aIx nokogiri -i /home/travis/.rvm/gems/ruby-2.4.1@global nokogiri
|
8
8
|
|
9
9
|
script: bash ./rake-script.sh
|
@@ -13,8 +13,10 @@ rvm:
|
|
13
13
|
- 2.1.0
|
14
14
|
- 2.1.1
|
15
15
|
- 2.1.5
|
16
|
-
- 2.2.
|
17
|
-
- 2.3.
|
16
|
+
- 2.2.10
|
17
|
+
- 2.3.7
|
18
|
+
- 2.4.4
|
19
|
+
- 2.5.1
|
18
20
|
- jruby-head
|
19
21
|
|
20
22
|
matrix:
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,15 @@
|
|
1
|
+
## 0.4.9
|
2
|
+
|
3
|
+
**Added**
|
4
|
+
- Current Ruby versions added in .travis.yml for testing
|
5
|
+
- Asynchronous deletion of Managed Disk added
|
6
|
+
|
7
|
+
**Changed**
|
8
|
+
|
9
|
+
- List method which handles pagination by default has been updated for Network Security Group.
|
10
|
+
- .travis.yml updated to handle bundler gem dependency on Ruby 2.3+
|
11
|
+
- Mocks for Azure::Blobs updated
|
12
|
+
|
1
13
|
## 0.4.8
|
2
14
|
|
3
15
|
**Added:**
|
data/README.md
CHANGED
@@ -388,6 +388,8 @@ Get an managed disk object from the get method and then destroy that managed dis
|
|
388
388
|
|
389
389
|
```ruby
|
390
390
|
managed_disk.destroy
|
391
|
+
# Can be made asynchronously (is synchronous by default)
|
392
|
+
managed_disk.destroy(true)
|
391
393
|
```
|
392
394
|
|
393
395
|
## Check Availability Set Existence
|
@@ -46,8 +46,10 @@ module Fog
|
|
46
46
|
merge_attributes(Fog::Compute::AzureRM::ManagedDisk.parse(disk))
|
47
47
|
end
|
48
48
|
|
49
|
-
def destroy
|
50
|
-
service.delete_managed_disk(resource_group_name, name
|
49
|
+
def destroy(async = false)
|
50
|
+
response = service.delete_managed_disk(resource_group_name, name,
|
51
|
+
async)
|
52
|
+
async ? create_fog_async_response(response) : response
|
51
53
|
end
|
52
54
|
|
53
55
|
private
|
@@ -71,6 +73,11 @@ module Fog
|
|
71
73
|
encryption_settings: encryption_settings
|
72
74
|
}
|
73
75
|
end
|
76
|
+
|
77
|
+
def create_fog_async_response(response, delete_extra_resource = false)
|
78
|
+
disk = Fog::Compute::AzureRM::ManagedDisk.new(service: service)
|
79
|
+
Fog::AzureRM::AsyncResponse.new(disk, response, delete_extra_resource)
|
80
|
+
end
|
74
81
|
end
|
75
82
|
end
|
76
83
|
end
|
@@ -4,16 +4,24 @@ module Fog
|
|
4
4
|
class AzureRM
|
5
5
|
# Real class for Compute Request
|
6
6
|
class Real
|
7
|
-
def delete_managed_disk(resource_group_name, disk_name)
|
7
|
+
def delete_managed_disk(resource_group_name, disk_name, async)
|
8
8
|
msg = "Deleting Managed Disk: #{disk_name}"
|
9
9
|
Fog::Logger.debug msg
|
10
10
|
begin
|
11
|
-
|
11
|
+
if async
|
12
|
+
response = @compute_mgmt_client.disks.delete_async(resource_group_name, disk_name)
|
13
|
+
else
|
14
|
+
@compute_mgmt_client.disks.delete(resource_group_name, disk_name)
|
15
|
+
end
|
12
16
|
rescue MsRestAzure::AzureOperationError => e
|
13
17
|
raise_azure_exception(e, msg)
|
14
18
|
end
|
15
|
-
|
16
|
-
|
19
|
+
if async
|
20
|
+
response
|
21
|
+
else
|
22
|
+
Fog::Logger.debug "Managed Disk #{disk_name} deleted successfully."
|
23
|
+
true
|
24
|
+
end
|
17
25
|
end
|
18
26
|
end
|
19
27
|
|
@@ -8,160 +8,156 @@ module Fog
|
|
8
8
|
Fog::Logger.debug msg
|
9
9
|
|
10
10
|
begin
|
11
|
-
nsg_list_result = @network_client.network_security_groups.
|
11
|
+
nsg_list_result = @network_client.network_security_groups.list(resource_group)
|
12
12
|
rescue MsRestAzure::AzureOperationError => e
|
13
13
|
raise_azure_exception(e, msg)
|
14
14
|
end
|
15
15
|
|
16
16
|
Fog::Logger.debug "Network Security Groups list retrieved successfully from Resource Group #{resource_group}."
|
17
|
-
nsg_list_result
|
17
|
+
nsg_list_result
|
18
18
|
end
|
19
19
|
end
|
20
20
|
|
21
21
|
# Mock class for Network Request
|
22
22
|
class Mock
|
23
23
|
def list_network_security_groups(resource_group)
|
24
|
-
|
25
|
-
|
26
|
-
{
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
{
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
{
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
{
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
{
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
{
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
{
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
{
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
]
|
162
|
-
}
|
163
|
-
nsg_mapper = Azure::ARM::Network::Models::NetworkInterfaceListResult.mapper
|
164
|
-
@network_client.deserialize(nsg_mapper, nsg_list_result, 'result.body').value
|
24
|
+
[
|
25
|
+
{
|
26
|
+
'id' => "/subscriptions/########-####-####-####-############/resourceGroups/#{resource_group}/providers/Microsoft.Network/networkSecurityGroups/testGroup",
|
27
|
+
'name' => 'testGroup',
|
28
|
+
'type' => 'Microsoft.Network/networkSecurityGroups',
|
29
|
+
'location' => 'westus',
|
30
|
+
'properties' =>
|
31
|
+
{
|
32
|
+
'securityRules' =>
|
33
|
+
[
|
34
|
+
{
|
35
|
+
'id' => "/subscriptions/########-####-####-####-############/resourceGroups/#{resource_group}/providers/Microsoft.Network/networkSecurityGroups/testGroup/securityRules/testRule",
|
36
|
+
'properties' =>
|
37
|
+
{
|
38
|
+
'protocol' => 'tcp',
|
39
|
+
'sourceAddressPrefix' => '0.0.0.0/0',
|
40
|
+
'destinationAddressPrefix' => '0.0.0.0/0',
|
41
|
+
'access' => 'Allow',
|
42
|
+
'direction' => 'Inbound',
|
43
|
+
'sourcePortRange' => '22',
|
44
|
+
'destinationPortRange' => '22',
|
45
|
+
'priority' => 100,
|
46
|
+
'provisioningState' => 'Succeeded'
|
47
|
+
},
|
48
|
+
'name' => 'testRule'
|
49
|
+
}
|
50
|
+
],
|
51
|
+
'defaultSecurityRules' =>
|
52
|
+
[
|
53
|
+
{
|
54
|
+
'id' => "/subscriptions/########-####-####-####-############/resourceGroups/#{resource_group}/providers/Microsoft.Network/networkSecurityGroups/testGroup/defaultSecurityRules/AllowVnetInBound",
|
55
|
+
'properties' =>
|
56
|
+
{
|
57
|
+
'protocol' => '*',
|
58
|
+
'sourceAddressPrefix' => 'VirtualNetwork',
|
59
|
+
'destinationAddressPrefix' => 'VirtualNetwork',
|
60
|
+
'access' => 'Allow',
|
61
|
+
'direction' => 'Inbound',
|
62
|
+
'description' => 'Allow inbound traffic from all VMs in VNET',
|
63
|
+
'sourcePortRange' => '*',
|
64
|
+
'destinationPortRange' => '*',
|
65
|
+
'priority' => 65_000,
|
66
|
+
'provisioningState' => 'Succeeded'
|
67
|
+
},
|
68
|
+
'name' => 'AllowVnetInBound'
|
69
|
+
},
|
70
|
+
{
|
71
|
+
'id' => "/subscriptions/########-####-####-####-############/resourceGroups/#{resource_group}/providers/Microsoft.Network/networkSecurityGroups/testGroup/defaultSecurityRules/AllowAzureLoadBalancerInBound",
|
72
|
+
'properties' =>
|
73
|
+
{
|
74
|
+
'protocol' => '*',
|
75
|
+
'sourceAddressPrefix' => 'AzureLoadBalancer',
|
76
|
+
'destinationAddressPrefix' => '*',
|
77
|
+
'access' => 'Allow',
|
78
|
+
'direction' => 'Inbound',
|
79
|
+
'description' => 'Allow inbound traffic from azure load balancer',
|
80
|
+
'sourcePortRange' => '*',
|
81
|
+
'destinationPortRange' => '*',
|
82
|
+
'priority' => 65_001,
|
83
|
+
'provisioningState' => 'Succeeded'
|
84
|
+
},
|
85
|
+
'name' => 'AllowAzureLoadBalancerInBound'
|
86
|
+
},
|
87
|
+
{
|
88
|
+
'id' => "/subscriptions/########-####-####-####-############/resourceGroups/#{resource_group}/providers/Microsoft.Network/networkSecurityGroups/testGroup/defaultSecurityRules/DenyAllInBound",
|
89
|
+
'properties' =>
|
90
|
+
{
|
91
|
+
'protocol' => '*',
|
92
|
+
'sourceAddressPrefix' => '*',
|
93
|
+
'destinationAddressPrefix' => '*',
|
94
|
+
'access' => 'Deny',
|
95
|
+
'direction' => 'Inbound',
|
96
|
+
'description' => 'Deny all inbound traffic',
|
97
|
+
'sourcePortRange' => '*',
|
98
|
+
'destinationPortRange' => '*',
|
99
|
+
'priority' => 65_500,
|
100
|
+
'provisioningState' => 'Succeeded'
|
101
|
+
},
|
102
|
+
'name' => 'DenyAllInBound'
|
103
|
+
},
|
104
|
+
{
|
105
|
+
'id' => "/subscriptions/########-####-####-####-############/resourceGroups/#{resource_group}/providers/Microsoft.Network/networkSecurityGroups/testGroup/defaultSecurityRules/AllowVnetOutBound",
|
106
|
+
'properties' =>
|
107
|
+
{
|
108
|
+
'protocol' => '*',
|
109
|
+
'sourceAddressPrefix' => 'VirtualNetwork',
|
110
|
+
'destinationAddressPrefix' => 'VirtualNetwork',
|
111
|
+
'access' => 'Allow',
|
112
|
+
'direction' => 'Outbound',
|
113
|
+
'description' => 'Allow outbound traffic from all VMs to all VMs in VNET',
|
114
|
+
'sourcePortRange' => '*',
|
115
|
+
'destinationPortRange' => '*',
|
116
|
+
'priority' => 65_000,
|
117
|
+
'provisioningState' => 'Succeeded'
|
118
|
+
},
|
119
|
+
'name' => 'AllowVnetOutBound'
|
120
|
+
},
|
121
|
+
{
|
122
|
+
'id' => "/subscriptions/########-####-####-####-############/resourceGroups/#{resource_group}/providers/Microsoft.Network/networkSecurityGroups/testGroup/defaultSecurityRules/AllowInternetOutBound",
|
123
|
+
'properties' =>
|
124
|
+
{
|
125
|
+
'protocol' => '*',
|
126
|
+
'sourceAddressPrefix' => '*',
|
127
|
+
'destinationAddressPrefix' => 'Internet',
|
128
|
+
'access' => 'Allow',
|
129
|
+
'direction' => 'Outbound',
|
130
|
+
'description' => 'Allow outbound traffic from all VMs to Internet',
|
131
|
+
'sourcePortRange' => '*',
|
132
|
+
'destinationPortRange' => '*',
|
133
|
+
'priority' => 65_001,
|
134
|
+
'provisioningState' => 'Succeeded'
|
135
|
+
},
|
136
|
+
'name' => 'AllowInternetOutBound'
|
137
|
+
},
|
138
|
+
{
|
139
|
+
'id' => "/subscriptions/########-####-####-####-############/resourceGroups/#{resource_group}/providers/Microsoft.Network/networkSecurityGroups/testGroup/defaultSecurityRules/DenyAllOutBound",
|
140
|
+
'properties' =>
|
141
|
+
{
|
142
|
+
'protocol' => '*',
|
143
|
+
'sourceAddressPrefix' => '*',
|
144
|
+
'destinationAddressPrefix' => '*',
|
145
|
+
'access' => 'Deny',
|
146
|
+
'direction' => 'Outbound',
|
147
|
+
'description' => 'Deny all outbound traffic',
|
148
|
+
'sourcePortRange' => '*',
|
149
|
+
'destinationPortRange' => '*',
|
150
|
+
'priority' => 65_500,
|
151
|
+
'provisioningState' => 'Succeeded'
|
152
|
+
},
|
153
|
+
'name' => 'DenyAllOutBound'
|
154
|
+
}
|
155
|
+
],
|
156
|
+
'resourceGuid' => '9dca97e6-4789-4ebd-86e3-52b8b0da6cd4',
|
157
|
+
'provisioningState' => 'Succeeded'
|
158
|
+
}
|
159
|
+
}
|
160
|
+
]
|
165
161
|
end
|
166
162
|
end
|
167
163
|
end
|
@@ -21,33 +21,33 @@ module Fog
|
|
21
21
|
# This class provides the mock implementation for unit tests.
|
22
22
|
class Mock
|
23
23
|
def get_blob_properties(*)
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
}
|
24
|
+
blob = Azure::Storage::Blob::Blob.new
|
25
|
+
blob.name = 'test_blob'
|
26
|
+
blob.metadata = {}
|
27
|
+
blob.properties = {
|
28
|
+
last_modified: 'Mon, 04 Jul 2016 09:30:31 GMT',
|
29
|
+
etag: '0x8D3A3EDD7C2B777',
|
30
|
+
lease_status: 'unlocked',
|
31
|
+
lease_state: 'available',
|
32
|
+
lease_duration: nil,
|
33
|
+
content_length: 4_194_304,
|
34
|
+
content_type: 'application/octet-stream',
|
35
|
+
content_encoding: nil,
|
36
|
+
content_language: nil,
|
37
|
+
content_disposition: nil,
|
38
|
+
content_md5: 'tXAohIyxuu/t94Lp/ujeRw==',
|
39
|
+
cache_control: nil,
|
40
|
+
sequence_number: 0,
|
41
|
+
blob_type: 'PageBlob',
|
42
|
+
copy_id: '095adc3b-e277-4c3d-97e0-0abca881f60c',
|
43
|
+
copy_status: 'success',
|
44
|
+
copy_source: 'https://testaccount.blob.core.windows.net/testblob/4m?snapshot=2016-02-04T08%3A35%3A50.3157696Z',
|
45
|
+
copy_progress: '4194304/4194304',
|
46
|
+
copy_completion_time: 'Thu, 04 Feb 2016 08:35:52 GMT',
|
47
|
+
copy_status_description: nil,
|
48
|
+
accept_ranges: 0
|
50
49
|
}
|
50
|
+
blob
|
51
51
|
end
|
52
52
|
end
|
53
53
|
end
|
data/lib/fog/azurerm/storage.rb
CHANGED
data/lib/fog/azurerm/version.rb
CHANGED
@@ -216,8 +216,8 @@ module ApiStub
|
|
216
216
|
}
|
217
217
|
]
|
218
218
|
}'
|
219
|
-
result_mapper = Azure::ARM::Network::Models::
|
220
|
-
network_client.deserialize(result_mapper, Fog::JSON.decode(nsg_list), 'result.body')
|
219
|
+
result_mapper = Azure::ARM::Network::Models::NetworkSecurityGroupListResult.mapper
|
220
|
+
network_client.deserialize(result_mapper, Fog::JSON.decode(nsg_list), 'result.body').value
|
221
221
|
end
|
222
222
|
end
|
223
223
|
end
|
@@ -5,6 +5,15 @@ module ApiStub
|
|
5
5
|
# Below data should be as same as those in Mock classes in lib/fog/azurerm/requests/storage/*.rb
|
6
6
|
class File
|
7
7
|
def self.blob
|
8
|
+
blob_data = blob_as_hash
|
9
|
+
blob = Azure::Storage::Blob::Blob.new
|
10
|
+
blob.name = blob_data['name']
|
11
|
+
blob.metadata = blob_data['metadata']
|
12
|
+
blob.properties = blob_data['properties'].map { |k, v| { k.to_sym => v } }.reduce({}, &:merge!)
|
13
|
+
blob
|
14
|
+
end
|
15
|
+
|
16
|
+
def self.blob_as_hash
|
8
17
|
{
|
9
18
|
'name' => 'test_blob',
|
10
19
|
'metadata' => {},
|
@@ -50,13 +50,20 @@ class TestManagedDisk < Minitest::Test
|
|
50
50
|
|
51
51
|
def test_destroy_method_true_response
|
52
52
|
@service.stub :delete_managed_disk, true do
|
53
|
-
assert @managed_disk.destroy
|
53
|
+
assert @managed_disk.destroy(false)
|
54
54
|
end
|
55
55
|
end
|
56
56
|
|
57
57
|
def test_destroy_method_false_response
|
58
58
|
@service.stub :delete_managed_disk, false do
|
59
|
-
assert !@managed_disk.destroy
|
59
|
+
assert !@managed_disk.destroy(false)
|
60
|
+
end
|
61
|
+
end
|
62
|
+
|
63
|
+
def test_destroy_method_can_take_params_async
|
64
|
+
async_response = Concurrent::Promise.execute { 10 }
|
65
|
+
@service.stub :delete_managed_disk, async_response do
|
66
|
+
assert_instance_of Fog::AzureRM::AsyncResponse, @managed_disk.destroy(true)
|
60
67
|
end
|
61
68
|
end
|
62
69
|
end
|
@@ -10,14 +10,14 @@ class TestDeleteManagedDisk < Minitest::Test
|
|
10
10
|
|
11
11
|
def test_delete_managed_disk_success
|
12
12
|
@managed_disks.stub :delete, true do
|
13
|
-
assert @service.delete_managed_disk('fog-test-rg', 'test-disk')
|
13
|
+
assert @service.delete_managed_disk('fog-test-rg', 'test-disk', false)
|
14
14
|
end
|
15
15
|
end
|
16
16
|
|
17
17
|
def test_delete_managed_disk_failure
|
18
18
|
response = proc { raise MsRestAzure::AzureOperationError.new(nil, nil, 'error' => { 'message' => 'mocked exception' }) }
|
19
19
|
@managed_disks.stub :delete, response do
|
20
|
-
assert_raises(MsRestAzure::AzureOperationError) { @service.delete_managed_disk('fog-test-rg', 'test-disk') }
|
20
|
+
assert_raises(MsRestAzure::AzureOperationError) { @service.delete_managed_disk('fog-test-rg', 'test-disk', false) }
|
21
21
|
end
|
22
22
|
end
|
23
23
|
end
|
@@ -10,14 +10,14 @@ class TestListNetworkSecurityGroup < Minitest::Test
|
|
10
10
|
|
11
11
|
def test_list_network_security_group_success
|
12
12
|
mocked_response = ApiStub::Requests::Network::NetworkSecurityGroup.list_network_security_group_response(@client)
|
13
|
-
@network_security_groups.stub :
|
14
|
-
assert_equal @service.list_network_security_groups('fog-test-rg'), mocked_response
|
13
|
+
@network_security_groups.stub :list, mocked_response do
|
14
|
+
assert_equal @service.list_network_security_groups('fog-test-rg'), mocked_response
|
15
15
|
end
|
16
16
|
end
|
17
17
|
|
18
18
|
def test_list_network_security_group_failure
|
19
19
|
response = proc { raise MsRestAzure::AzureOperationError.new(nil, nil, 'error' => { 'message' => 'mocked exception' }) }
|
20
|
-
@network_security_groups.stub :
|
20
|
+
@network_security_groups.stub :list, response do
|
21
21
|
assert_raises MsRestAzure::AzureOperationError do
|
22
22
|
@service.list_network_security_groups('fog-test-rg')
|
23
23
|
end
|
@@ -13,7 +13,7 @@ class TestGetBlob < Minitest::Test
|
|
13
13
|
@blob_client = @service.instance_variable_get(:@blob_client)
|
14
14
|
|
15
15
|
@raw_cloud_blob = storage_blob
|
16
|
-
@blob = ApiStub::Requests::Storage::File.
|
16
|
+
@blob = ApiStub::Requests::Storage::File.blob_as_hash
|
17
17
|
@blob_with_content = [
|
18
18
|
@blob,
|
19
19
|
'content'
|
@@ -40,6 +40,8 @@ class TestGetBlobProperties < Minitest::Test
|
|
40
40
|
end
|
41
41
|
|
42
42
|
def test_get_blob_properties_mock
|
43
|
-
|
43
|
+
mock_blob_properties = @mock_service.get_blob_properties('test_container', 'test_blob')
|
44
|
+
assert_equal @blob.name, mock_blob_properties.name
|
45
|
+
assert_equal @blob.properties, mock_blob_properties.properties
|
44
46
|
end
|
45
47
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fog-azure-rm
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.9
|
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: 2019-01-18 00:00:00.000000000 Z
|
22
22
|
dependencies:
|
23
23
|
- !ruby/object:Gem::Dependency
|
24
24
|
name: rake
|
@@ -1059,8 +1059,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
1059
1059
|
- !ruby/object:Gem::Version
|
1060
1060
|
version: '0'
|
1061
1061
|
requirements: []
|
1062
|
-
|
1063
|
-
rubygems_version: 2.7.7
|
1062
|
+
rubygems_version: 3.0.2
|
1064
1063
|
signing_key:
|
1065
1064
|
specification_version: 4
|
1066
1065
|
summary: Module for the 'fog' gem to support Azure Resource Manager cloud services.
|