fog-azure-rm-temp 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (209) hide show
  1. checksums.yaml +4 -4
  2. data/.arclint +8 -0
  3. data/.travis.yml +28 -14
  4. data/CHANGELOG.md +77 -0
  5. data/CONTRIBUTORS.md +4 -0
  6. data/fog-azure-rm.gemspec +3 -2
  7. data/lib/fog/azurerm.rb +1 -0
  8. data/lib/fog/azurerm/async_response.rb +9 -1
  9. data/lib/fog/azurerm/compute.rb +3 -1
  10. data/lib/fog/azurerm/constants.rb +11 -3
  11. data/lib/fog/azurerm/dns.rb +3 -1
  12. data/lib/fog/azurerm/docs/application_gateway.md +119 -117
  13. data/lib/fog/azurerm/docs/compute.md +299 -202
  14. data/lib/fog/azurerm/docs/dns.md +44 -43
  15. data/lib/fog/azurerm/docs/key_vault.md +31 -28
  16. data/lib/fog/azurerm/docs/network.md +407 -404
  17. data/lib/fog/azurerm/docs/resources.md +52 -49
  18. data/lib/fog/azurerm/docs/sql.md +56 -54
  19. data/lib/fog/azurerm/docs/storage.md +92 -157
  20. data/lib/fog/azurerm/docs/traffic_manager.md +55 -53
  21. data/lib/fog/azurerm/models/application_gateway/gateway.rb +5 -1
  22. data/lib/fog/azurerm/models/compute/availability_set.rb +4 -1
  23. data/lib/fog/azurerm/models/compute/managed_disk.rb +0 -1
  24. data/lib/fog/azurerm/models/compute/server.rb +61 -11
  25. data/lib/fog/azurerm/models/compute/servers.rb +2 -2
  26. data/lib/fog/azurerm/models/dns/a_record.rb +15 -0
  27. data/lib/fog/azurerm/models/dns/cname_record.rb +15 -0
  28. data/lib/fog/azurerm/models/dns/record_set.rb +20 -8
  29. data/lib/fog/azurerm/models/key_vault/vault.rb +3 -1
  30. data/lib/fog/azurerm/models/network/load_balancer.rb +3 -1
  31. data/lib/fog/azurerm/models/network/local_network_gateway.rb +3 -1
  32. data/lib/fog/azurerm/models/network/network_interface.rb +3 -1
  33. data/lib/fog/azurerm/models/network/network_security_group.rb +4 -2
  34. data/lib/fog/azurerm/models/network/public_ip.rb +4 -2
  35. data/lib/fog/azurerm/models/network/virtual_network.rb +4 -2
  36. data/lib/fog/azurerm/models/resources/resource_group.rb +3 -1
  37. data/lib/fog/azurerm/models/sql/sql_database.rb +3 -3
  38. data/lib/fog/azurerm/models/sql/sql_server.rb +3 -2
  39. data/lib/fog/azurerm/models/storage/directories.rb +6 -1
  40. data/lib/fog/azurerm/models/storage/file.rb +2 -0
  41. data/lib/fog/azurerm/models/storage/storage_account.rb +4 -1
  42. data/lib/fog/azurerm/models/storage/storage_accounts.rb +7 -0
  43. data/lib/fog/azurerm/models/traffic_manager/traffic_manager_profile.rb +3 -1
  44. data/lib/fog/azurerm/requests/application_gateway/check_ag_exists.rb +1 -1
  45. data/lib/fog/azurerm/requests/application_gateway/create_or_update_application_gateway.rb +1 -0
  46. data/lib/fog/azurerm/requests/compute/attach_data_disk_to_vm.rb +2 -2
  47. data/lib/fog/azurerm/requests/compute/check_availability_set_exists.rb +1 -1
  48. data/lib/fog/azurerm/requests/compute/check_managed_disk_exists.rb +1 -1
  49. data/lib/fog/azurerm/requests/compute/check_vm_exists.rb +1 -1
  50. data/lib/fog/azurerm/requests/compute/check_vm_extension_exists.rb +2 -2
  51. data/lib/fog/azurerm/requests/compute/create_availability_set.rb +4 -2
  52. data/lib/fog/azurerm/requests/compute/create_image.rb +68 -0
  53. data/lib/fog/azurerm/requests/compute/create_virtual_machine.rb +302 -135
  54. data/lib/fog/azurerm/requests/compute/delete_image.rb +29 -0
  55. data/lib/fog/azurerm/requests/compute/get_image.rb +45 -0
  56. data/lib/fog/azurerm/requests/compute/get_virtual_machine.rb +4 -2
  57. data/lib/fog/azurerm/requests/dns/check_record_set_exists.rb +1 -1
  58. data/lib/fog/azurerm/requests/dns/check_zone_exists.rb +3 -2
  59. data/lib/fog/azurerm/requests/dns/create_or_update_record_set.rb +3 -2
  60. data/lib/fog/azurerm/requests/dns/create_or_update_zone.rb +1 -2
  61. data/lib/fog/azurerm/requests/key_vault/check_vault_exists.rb +1 -1
  62. data/lib/fog/azurerm/requests/key_vault/create_or_update_vault.rb +1 -0
  63. data/lib/fog/azurerm/requests/network/check_express_route_cir_auth_exists.rb +1 -1
  64. data/lib/fog/azurerm/requests/network/check_express_route_circuit_exists.rb +1 -1
  65. data/lib/fog/azurerm/requests/network/check_load_balancer_exists.rb +1 -1
  66. data/lib/fog/azurerm/requests/network/check_local_net_gateway_exists.rb +1 -1
  67. data/lib/fog/azurerm/requests/network/check_net_sec_group_exists.rb +1 -1
  68. data/lib/fog/azurerm/requests/network/check_net_sec_rule_exists.rb +1 -1
  69. data/lib/fog/azurerm/requests/network/check_network_interface_exists.rb +1 -1
  70. data/lib/fog/azurerm/requests/network/check_public_ip_exists.rb +1 -1
  71. data/lib/fog/azurerm/requests/network/check_subnet_exists.rb +1 -1
  72. data/lib/fog/azurerm/requests/network/check_virtual_network_exists.rb +1 -1
  73. data/lib/fog/azurerm/requests/network/check_vnet_gateway_connection_exists.rb +1 -1
  74. data/lib/fog/azurerm/requests/network/check_vnet_gateway_exists.rb +1 -1
  75. data/lib/fog/azurerm/requests/network/create_load_balancer.rb +4 -4
  76. data/lib/fog/azurerm/requests/network/create_or_update_express_route_circuit.rb +1 -1
  77. data/lib/fog/azurerm/requests/network/create_or_update_local_network_gateway.rb +1 -2
  78. data/lib/fog/azurerm/requests/network/create_or_update_network_interface.rb +4 -3
  79. data/lib/fog/azurerm/requests/network/create_or_update_network_security_group.rb +4 -3
  80. data/lib/fog/azurerm/requests/network/create_or_update_public_ip.rb +5 -3
  81. data/lib/fog/azurerm/requests/network/create_or_update_virtual_network.rb +4 -3
  82. data/lib/fog/azurerm/requests/network/create_or_update_virtual_network_gateway_connection.rb +1 -1
  83. data/lib/fog/azurerm/requests/resources/check_azure_resource_exists.rb +4 -4
  84. data/lib/fog/azurerm/requests/resources/create_resource_group.rb +2 -1
  85. data/lib/fog/azurerm/requests/resources/delete_resource_tag.rb +4 -4
  86. data/lib/fog/azurerm/requests/resources/tag_resource.rb +4 -4
  87. data/lib/fog/azurerm/requests/sql/create_or_update_database.rb +13 -10
  88. data/lib/fog/azurerm/requests/sql/create_or_update_sql_server.rb +8 -5
  89. data/lib/fog/azurerm/requests/storage/check_storage_account_exists.rb +1 -1
  90. data/lib/fog/azurerm/requests/storage/create_storage_account.rb +4 -2
  91. data/lib/fog/azurerm/requests/traffic_manager/check_traffic_manager_endpoint_exists.rb +1 -1
  92. data/lib/fog/azurerm/requests/traffic_manager/check_traffic_manager_profile_exists.rb +1 -1
  93. data/lib/fog/azurerm/requests/traffic_manager/create_or_update_traffic_manager_profile.rb +13 -3
  94. data/lib/fog/azurerm/storage.rb +0 -18
  95. data/lib/fog/azurerm/utilities/general.rb +21 -10
  96. data/lib/fog/azurerm/version.rb +1 -1
  97. data/rake-script.sh +7 -1
  98. data/rakefile +1 -1
  99. data/test/api_stub.rb +19 -2
  100. data/test/api_stub/models/compute/server.rb +21 -5
  101. data/test/api_stub/requests/compute/image.rb +41 -0
  102. data/test/api_stub/requests/compute/virtual_machine.rb +60 -62
  103. data/test/api_stub/requests/resources/resource_group.rb +1 -1
  104. data/test/integration/application_gateway.rb +8 -1
  105. data/test/integration/availability_set.rb +9 -2
  106. data/test/integration/external_load_balancer.rb +2 -1
  107. data/test/integration/internal_load_balancer.rb +2 -1
  108. data/test/integration/key_vault.rb +2 -1
  109. data/test/integration/managed_disk.rb +10 -5
  110. data/test/integration/network_interface.rb +2 -1
  111. data/test/integration/network_security_group.rb +2 -1
  112. data/test/integration/public_ip.rb +2 -1
  113. data/test/integration/record_set.rb +5 -5
  114. data/test/integration/resource_group.rb +5 -2
  115. data/test/integration/resource_tag.rb +4 -2
  116. data/test/integration/server.rb +113 -23
  117. data/test/integration/server_custom_image.rb +120 -20
  118. data/test/integration/sql_server.rb +10 -2
  119. data/test/integration/storage_account.rb +32 -20
  120. data/test/integration/traffic_manager.rb +6 -1
  121. data/test/integration/virtual_network.rb +2 -1
  122. data/test/integration/virtual_network_gateway_connection.rb +3 -3
  123. data/test/models/application_gateway/test_gateway.rb +2 -1
  124. data/test/models/compute/test_availability_set.rb +2 -1
  125. data/test/models/compute/test_managed_disk.rb +2 -1
  126. data/test/models/compute/test_server.rb +13 -4
  127. data/test/models/dns/test_zone.rb +2 -1
  128. data/test/models/key_vault/test_vault.rb +2 -1
  129. data/test/models/network/test_load_balancer.rb +2 -1
  130. data/test/models/network/test_network_interface.rb +2 -1
  131. data/test/models/network/test_network_security_group.rb +2 -1
  132. data/test/models/network/test_public_ip.rb +2 -1
  133. data/test/models/network/test_virtual_network.rb +2 -1
  134. data/test/models/resources/test_resource_group.rb +2 -1
  135. data/test/models/sql/test_database.rb +2 -1
  136. data/test/models/sql/test_sql_server.rb +2 -1
  137. data/test/models/storage/test_storage_account.rb +2 -1
  138. data/test/models/traffic_manager/test_traffic_manager_profile.rb +2 -1
  139. data/test/requests/application_gateway/test_check_ag_exists.rb +11 -4
  140. data/test/requests/compute/test_attach_data_disk_to_vm.rb +2 -2
  141. data/test/requests/compute/test_check_availability_set_exists.rb +9 -2
  142. data/test/requests/compute/test_check_managed_disk_exists.rb +9 -2
  143. data/test/requests/compute/test_check_vm_exists.rb +9 -2
  144. data/test/requests/compute/test_check_vm_extension_exists.rb +9 -2
  145. data/test/requests/compute/test_create_image.rb +27 -0
  146. data/test/requests/compute/test_create_virtual_machine.rb +41 -17
  147. data/test/requests/compute/test_delete_image.rb +23 -0
  148. data/test/requests/compute/test_get_image.rb +23 -0
  149. data/test/requests/dns/test_check_record_set_exists.rb +9 -2
  150. data/test/requests/dns/test_check_zone_exists.rb +16 -2
  151. data/test/requests/key_vault/test_check_vault_exists.rb +9 -2
  152. data/test/requests/network/test_check_express_route_cir_auth_exists.rb +9 -2
  153. data/test/requests/network/test_check_express_route_circuit_exists.rb +9 -2
  154. data/test/requests/network/test_check_load_balancer_exists.rb +9 -2
  155. data/test/requests/network/test_check_local_net_gateway_exists.rb +11 -4
  156. data/test/requests/network/test_check_net_sec_group_exists.rb +9 -2
  157. data/test/requests/network/test_check_net_sec_rule_exists.rb +9 -2
  158. data/test/requests/network/test_check_network_interface_exists.rb +9 -2
  159. data/test/requests/network/test_check_public_ip_exists.rb +9 -2
  160. data/test/requests/network/test_check_subnet_exists.rb +9 -2
  161. data/test/requests/network/test_check_virtual_network_exists.rb +10 -4
  162. data/test/requests/network/test_check_vnet_gateway_connection_exists.rb +9 -2
  163. data/test/requests/network/test_check_vnet_gateway_exists.rb +9 -2
  164. data/test/requests/network/test_create_load_balancer.rb +3 -2
  165. data/test/requests/network/test_create_network_interface.rb +4 -3
  166. data/test/requests/network/test_create_or_update_network_security_group.rb +3 -2
  167. data/test/requests/network/test_create_or_update_virtual_network.rb +5 -3
  168. data/test/requests/network/test_create_public_ip.rb +3 -2
  169. data/test/requests/network/test_update_public_ip.rb +3 -2
  170. data/test/requests/resources/test_create_resource_group.rb +3 -2
  171. data/test/requests/resources/test_delete_resource_tag.rb +3 -3
  172. data/test/requests/resources/test_tag_resource.rb +3 -3
  173. data/test/requests/storage/test_check_storage_account_exists.rb +8 -1
  174. data/test/requests/traffic_manager/test_check_traffic_manager_endpoint_exists.rb +9 -2
  175. data/test/requests/traffic_manager/test_check_traffic_manager_profile_exists.rb +9 -2
  176. data/test/test_helper.rb +5 -14
  177. metadata +67 -75
  178. data/lib/fog/azurerm/models/storage/recovery_vault.rb +0 -50
  179. data/lib/fog/azurerm/models/storage/recovery_vaults.rb +0 -27
  180. data/lib/fog/azurerm/requests/storage/create_or_update_recovery_vault.rb +0 -54
  181. data/lib/fog/azurerm/requests/storage/delete_recovery_vault.rb +0 -35
  182. data/lib/fog/azurerm/requests/storage/disable_backup_protection.rb +0 -60
  183. data/lib/fog/azurerm/requests/storage/enable_backup_protection.rb +0 -61
  184. data/lib/fog/azurerm/requests/storage/get_all_backup_jobs.rb +0 -56
  185. data/lib/fog/azurerm/requests/storage/get_backup_container.rb +0 -53
  186. data/lib/fog/azurerm/requests/storage/get_backup_item.rb +0 -58
  187. data/lib/fog/azurerm/requests/storage/get_backup_job_for_vm.rb +0 -53
  188. data/lib/fog/azurerm/requests/storage/get_backup_protection_policy.rb +0 -64
  189. data/lib/fog/azurerm/requests/storage/get_recovery_vault.rb +0 -49
  190. data/lib/fog/azurerm/requests/storage/list_recovery_vaults.rb +0 -48
  191. data/lib/fog/azurerm/requests/storage/set_recovery_vault_context.rb +0 -36
  192. data/lib/fog/azurerm/requests/storage/start_backup.rb +0 -54
  193. data/test/api_stub/models/storage/recovery_vault.rb +0 -23
  194. data/test/api_stub/requests/storage/recovery_vault.rb +0 -189
  195. data/test/models/storage/test_recovery_vault.rb +0 -61
  196. data/test/models/storage/test_recovery_vaults.rb +0 -47
  197. data/test/requests/storage/test_create_recovery_vault.rb +0 -35
  198. data/test/requests/storage/test_delete_recovery_vault.rb +0 -34
  199. data/test/requests/storage/test_disable_backup_protection.rb +0 -52
  200. data/test/requests/storage/test_enable_backup_protection.rb +0 -66
  201. data/test/requests/storage/test_get_all_backup_jobs.rb +0 -35
  202. data/test/requests/storage/test_get_backup_container.rb +0 -35
  203. data/test/requests/storage/test_get_backup_item.rb +0 -35
  204. data/test/requests/storage/test_get_backup_job_for_vm.rb +0 -26
  205. data/test/requests/storage/test_get_backup_protection_policy.rb +0 -35
  206. data/test/requests/storage/test_get_recovery_vault.rb +0 -35
  207. data/test/requests/storage/test_list_recovery_vault.rb +0 -35
  208. data/test/requests/storage/test_set_recovery_vault_context.rb +0 -34
  209. data/test/requests/storage/test_start_backup.rb +0 -55
@@ -16,14 +16,21 @@ class TestCheckLoadBalancerExists < Minitest::Test
16
16
  end
17
17
 
18
18
  def test_check_load_balancer_exists_failure
19
- response = proc { raise MsRestAzure::AzureOperationError.new(nil, nil, 'error' => { 'message' => 'mocked exception', 'code' => 'ResourceNotFound' }) }
19
+ response = proc { raise MsRestAzure::AzureOperationError.new(nil, create_mock_response, 'error' => { 'message' => 'mocked exception', 'code' => 'ResourceNotFound' }) }
20
+ @load_balancers.stub :get, response do
21
+ assert !@service.check_load_balancer_exists('fog-test-rg', 'mylb1')
22
+ end
23
+ end
24
+
25
+ def test_check_load_balancer_resource_group_exists_failure
26
+ response = proc { raise MsRestAzure::AzureOperationError.new(nil, create_mock_response, 'error' => { 'message' => 'mocked exception', 'code' => 'ResourceGroupNotFound' }) }
20
27
  @load_balancers.stub :get, response do
21
28
  assert !@service.check_load_balancer_exists('fog-test-rg', 'mylb1')
22
29
  end
23
30
  end
24
31
 
25
32
  def test_check_load_balancer_exists_exception
26
- response = proc { raise MsRestAzure::AzureOperationError.new(nil, nil, 'error' => { 'message' => 'mocked exception', 'code' => 'ResourceGroupNotFound' }) }
33
+ response = proc { raise MsRestAzure::AzureOperationError.new(nil, create_mock_response, 'error' => { 'message' => 'mocked exception', 'code' => 'Exception' }) }
27
34
  @load_balancers.stub :get, response do
28
35
  assert_raises(RuntimeError) { @service.check_load_balancer_exists('fog-test-rg', 'mylb1') }
29
36
  end
@@ -15,15 +15,22 @@ class TestCheckLocalNetworkGatewayExists < Minitest::Test
15
15
  end
16
16
  end
17
17
 
18
- def test_check_virtual_network_exists_failure
19
- response = proc { raise MsRestAzure::AzureOperationError.new(nil, nil, 'error' => { 'message' => 'mocked exception', 'code' => 'ResourceNotFound' }) }
18
+ def test_check_local_net_gateway_exists_failure
19
+ response = proc { raise MsRestAzure::AzureOperationError.new(nil, create_mock_response, 'error' => { 'message' => 'mocked exception', 'code' => 'ResourceNotFound' }) }
20
20
  @local_network_gateways.stub :get, response do
21
21
  assert !@service.check_local_net_gateway_exists('fog-test-rg', 'fog-test-local-network-gateway')
22
22
  end
23
23
  end
24
24
 
25
- def test_check_fvirtual_network_exists_exception
26
- response = proc { raise MsRestAzure::AzureOperationError.new(nil, nil, 'error' => { 'message' => 'mocked exception', 'code' => 'ResourceGroupNotFound' }) }
25
+ def test_check_local_net_gateway_resource_group_exists_failure
26
+ response = proc { raise MsRestAzure::AzureOperationError.new(nil, create_mock_response, 'error' => { 'message' => 'mocked exception', 'code' => 'ResourceGroupNotFound' }) }
27
+ @local_network_gateways.stub :get, response do
28
+ assert !@service.check_local_net_gateway_exists('fog-test-rg', 'fog-test-local-network-gateway')
29
+ end
30
+ end
31
+
32
+ def test_check_local_net_gateway_exists_exception
33
+ response = proc { raise MsRestAzure::AzureOperationError.new(nil, create_mock_response, 'error' => { 'message' => 'mocked exception', 'code' => 'Exception' }) }
27
34
  @local_network_gateways.stub :get, response do
28
35
  assert_raises(RuntimeError) { @service.check_local_net_gateway_exists('fog-test-rg', 'fog-test-local-network-gateway') }
29
36
  end
@@ -16,14 +16,21 @@ class TestCheckNetworkSecurityGroupExists < Minitest::Test
16
16
  end
17
17
 
18
18
  def test_check_net_sec_group_exists_failure
19
- response = proc { raise MsRestAzure::AzureOperationError.new(nil, nil, 'error' => { 'message' => 'mocked exception', 'code' => 'ResourceNotFound' }) }
19
+ response = proc { raise MsRestAzure::AzureOperationError.new(nil, create_mock_response, 'error' => { 'message' => 'mocked exception', 'code' => 'ResourceNotFound' }) }
20
+ @network_security_groups.stub :get, response do
21
+ assert !@service.check_net_sec_group_exists('fog-test-rg', 'fog-test-nsg')
22
+ end
23
+ end
24
+
25
+ def test_check_net_sec_group_resource_group_exists_failure
26
+ response = proc { raise MsRestAzure::AzureOperationError.new(nil, create_mock_response, 'error' => { 'message' => 'mocked exception', 'code' => 'ResourceGroupNotFound' }) }
20
27
  @network_security_groups.stub :get, response do
21
28
  assert !@service.check_net_sec_group_exists('fog-test-rg', 'fog-test-nsg')
22
29
  end
23
30
  end
24
31
 
25
32
  def test_check_net_sec_group_exists_exception
26
- response = proc { raise MsRestAzure::AzureOperationError.new(nil, nil, 'error' => { 'message' => 'mocked exception', 'code' => 'ResourceGroupNotFound' }) }
33
+ response = proc { raise MsRestAzure::AzureOperationError.new(nil, create_mock_response, 'error' => { 'message' => 'mocked exception', 'code' => 'Exception' }) }
27
34
  @network_security_groups.stub :get, response do
28
35
  assert_raises(RuntimeError) { @service.check_net_sec_group_exists('fog-test-rg', 'fog-test-nsg') }
29
36
  end
@@ -16,14 +16,21 @@ class TestCheckNetworkSecurityRuleExists < Minitest::Test
16
16
  end
17
17
 
18
18
  def test_check_net_sec_rule_exists_failure
19
- response = proc { raise MsRestAzure::AzureOperationError.new(nil, nil, 'error' => { 'message' => 'mocked exception', 'code' => 'ResourceNotFound' }) }
19
+ response = proc { raise MsRestAzure::AzureOperationError.new(nil, create_mock_response, 'error' => { 'message' => 'mocked exception', 'code' => 'ResourceNotFound' }) }
20
+ @network_security_rules.stub :get, response do
21
+ assert !@service.check_net_sec_rule_exists('fog-test-rg', 'fog-test-nsg', 'fog-test-nsr')
22
+ end
23
+ end
24
+
25
+ def test_check_net_sec_rule_resource_group_exists_failure
26
+ response = proc { raise MsRestAzure::AzureOperationError.new(nil, create_mock_response, 'error' => { 'message' => 'mocked exception', 'code' => 'ResourceGroupNotFound' }) }
20
27
  @network_security_rules.stub :get, response do
21
28
  assert !@service.check_net_sec_rule_exists('fog-test-rg', 'fog-test-nsg', 'fog-test-nsr')
22
29
  end
23
30
  end
24
31
 
25
32
  def test_check_net_sec_rule_exists_exception
26
- response = proc { raise MsRestAzure::AzureOperationError.new(nil, nil, 'error' => { 'message' => 'mocked exception', 'code' => 'ResourceGroupNotFound' }) }
33
+ response = proc { raise MsRestAzure::AzureOperationError.new(nil, create_mock_response, 'error' => { 'message' => 'mocked exception', 'code' => 'Exception' }) }
27
34
  @network_security_rules.stub :get, response do
28
35
  assert_raises(RuntimeError) { @service.check_net_sec_rule_exists('fog-test-rg', 'fog-test-nsg', 'fog-test-nsr') }
29
36
  end
@@ -16,14 +16,21 @@ class TestCheckNetworkInterfaceExists < Minitest::Test
16
16
  end
17
17
 
18
18
  def test_check_network_interface_exists_failure
19
- response = proc { raise MsRestAzure::AzureOperationError.new(nil, nil, 'error' => { 'message' => 'mocked exception', 'code' => 'ResourceNotFound' }) }
19
+ response = proc { raise MsRestAzure::AzureOperationError.new(nil, create_mock_response, 'error' => { 'message' => 'mocked exception', 'code' => 'ResourceNotFound' }) }
20
+ @network_interfaces.stub :get, response do
21
+ assert !@service.check_network_interface_exists('fog-test-rg', 'fog-test-network-interface')
22
+ end
23
+ end
24
+
25
+ def test_check_network_interface_resource_group_exists_failure
26
+ response = proc { raise MsRestAzure::AzureOperationError.new(nil, create_mock_response, 'error' => { 'message' => 'mocked exception', 'code' => 'ResourceGroupNotFound' }) }
20
27
  @network_interfaces.stub :get, response do
21
28
  assert !@service.check_network_interface_exists('fog-test-rg', 'fog-test-network-interface')
22
29
  end
23
30
  end
24
31
 
25
32
  def test_check_network_interface_exists_exception
26
- response = proc { raise MsRestAzure::AzureOperationError.new(nil, nil, 'error' => { 'message' => 'mocked exception', 'code' => 'ResourceGroupNotFound' }) }
33
+ response = proc { raise MsRestAzure::AzureOperationError.new(nil, create_mock_response, 'error' => { 'message' => 'mocked exception', 'code' => 'Exception' }) }
27
34
  @network_interfaces.stub :get, response do
28
35
  assert_raises(RuntimeError) { @service.check_network_interface_exists('fog-test-rg', 'fog-test-network-interface') }
29
36
  end
@@ -15,14 +15,21 @@ class TestCheckPublicIpExists < Minitest::Test
15
15
  end
16
16
 
17
17
  def test_check_public_ip_exists_failure
18
- response = proc { raise MsRestAzure::AzureOperationError.new(nil, nil, 'error' => { 'message' => 'mocked exception', 'code' => 'ResourceNotFound' }) }
18
+ response = proc { raise MsRestAzure::AzureOperationError.new(nil, create_mock_response, 'error' => { 'message' => 'mocked exception', 'code' => 'ResourceNotFound' }) }
19
+ @public_ips.stub :get, response do
20
+ assert !@service.check_public_ip_exists('fog-test-rg', 'fog-test-public-ip')
21
+ end
22
+ end
23
+
24
+ def test_check_public_ip_resource_group_exists_failure
25
+ response = proc { raise MsRestAzure::AzureOperationError.new(nil, create_mock_response, 'error' => { 'message' => 'mocked exception', 'code' => 'ResourceGroupNotFound' }) }
19
26
  @public_ips.stub :get, response do
20
27
  assert !@service.check_public_ip_exists('fog-test-rg', 'fog-test-public-ip')
21
28
  end
22
29
  end
23
30
 
24
31
  def test_check_public_ip_exists_exception
25
- response = proc { raise MsRestAzure::AzureOperationError.new(nil, nil, 'error' => { 'message' => 'mocked exception', 'code' => 'ResourceGroupNotFound' }) }
32
+ response = proc { raise MsRestAzure::AzureOperationError.new(nil, create_mock_response, 'error' => { 'message' => 'mocked exception', 'code' => 'Exception' }) }
26
33
  @public_ips.stub :get, response do
27
34
  assert_raises(RuntimeError) { @service.check_public_ip_exists('fog-test-rg', 'fog-test-public-ip') }
28
35
  end
@@ -16,14 +16,21 @@ class TestCheckSubnetExists < Minitest::Test
16
16
  end
17
17
 
18
18
  def test_check_subnet_exists_failure
19
- response = proc { raise MsRestAzure::AzureOperationError.new(nil, nil, 'error' => { 'message' => 'mocked exception', 'code' => 'ResourceNotFound' }) }
19
+ response = proc { raise MsRestAzure::AzureOperationError.new(nil, create_mock_response, 'error' => { 'message' => 'mocked exception', 'code' => 'ResourceNotFound' }) }
20
+ @subnets.stub :get, response do
21
+ assert !@service.check_subnet_exists('fog-test-rg', 'fog-test-virtual-network', 'fog-test-subnet')
22
+ end
23
+ end
24
+
25
+ def test_check_subnet_resource_group_exists_failure
26
+ response = proc { raise MsRestAzure::AzureOperationError.new(nil, create_mock_response, 'error' => { 'message' => 'mocked exception', 'code' => 'ResourceGroupNotFound' }) }
20
27
  @subnets.stub :get, response do
21
28
  assert !@service.check_subnet_exists('fog-test-rg', 'fog-test-virtual-network', 'fog-test-subnet')
22
29
  end
23
30
  end
24
31
 
25
32
  def test_check_subnet_exists_exception
26
- response = proc { raise MsRestAzure::AzureOperationError.new(nil, nil, 'error' => { 'message' => 'mocked exception', 'code' => 'ResourceGroupNotFound' }) }
33
+ response = proc { raise MsRestAzure::AzureOperationError.new(nil, create_mock_response, 'error' => { 'message' => 'mocked exception', 'code' => 'Exception' }) }
27
34
  @subnets.stub :get, response do
28
35
  assert_raises(RuntimeError) { @service.check_subnet_exists('fog-test-rg', 'fog-test-virtual-network', 'fog-test-subnet') }
29
36
  end
@@ -15,8 +15,15 @@ class TestCheckVirtualNetworkExists < Minitest::Test
15
15
  end
16
16
 
17
17
  def test_check_virtual_network_exists_failure
18
- faraday_response = Faraday::Response.new(nil)
19
- response = proc { raise MsRestAzure::AzureOperationError.new(nil, faraday_response, 'error' => { 'message' => 'mocked exception', 'code' => 'ResourceNotFound' }) }
18
+ response = proc { raise MsRestAzure::AzureOperationError.new(nil, create_mock_response, 'error' => { 'message' => 'mocked exception', 'code' => 'ResourceNotFound' }) }
19
+
20
+ @virtual_networks.stub :get, response do
21
+ assert !@service.check_virtual_network_exists('fog-test-rg', 'fog-test-virtual-network')
22
+ end
23
+ end
24
+
25
+ def test_check_virtual_network_resource_group_exists_failure
26
+ response = proc { raise MsRestAzure::AzureOperationError.new(nil, create_mock_response, 'error' => { 'message' => 'mocked exception', 'code' => 'ResourceGroupNotFound' }) }
20
27
 
21
28
  @virtual_networks.stub :get, response do
22
29
  assert !@service.check_virtual_network_exists('fog-test-rg', 'fog-test-virtual-network')
@@ -24,8 +31,7 @@ class TestCheckVirtualNetworkExists < Minitest::Test
24
31
  end
25
32
 
26
33
  def test_check_virtual_network_exists_exception
27
- faraday_response = Faraday::Response.new(nil)
28
- response = proc { raise MsRestAzure::AzureOperationError.new(nil, faraday_response, 'error' => { 'message' => 'mocked exception', 'code' => 'ResourceGroupNotFound' }) }
34
+ response = proc { raise MsRestAzure::AzureOperationError.new(nil, create_mock_response, 'error' => { 'message' => 'mocked exception', 'code' => 'Exception' }) }
29
35
 
30
36
  @virtual_networks.stub :get, response do
31
37
  assert_raises(RuntimeError) { @service.check_virtual_network_exists('fog-test-rg', 'fog-test-virtual-network') }
@@ -16,14 +16,21 @@ class TestCheckVirtualNetworkGatewayConnectionExists < Minitest::Test
16
16
  end
17
17
 
18
18
  def test_check_vnet_gateway_connection_exists_failure
19
- response = proc { raise MsRestAzure::AzureOperationError.new(nil, nil, 'error' => { 'message' => 'mocked exception', 'code' => 'ResourceNotFound' }) }
19
+ response = proc { raise MsRestAzure::AzureOperationError.new(nil, create_mock_response, 'error' => { 'message' => 'mocked exception', 'code' => 'ResourceNotFound' }) }
20
+ @gateway_connections.stub :get, response do
21
+ assert !@service.check_vnet_gateway_connection_exists('fog-test-rg', 'fog-test-gateway-connection')
22
+ end
23
+ end
24
+
25
+ def test_check_vnet_gateway_connection_resource_group_exists_failure
26
+ response = proc { raise MsRestAzure::AzureOperationError.new(nil, create_mock_response, 'error' => { 'message' => 'mocked exception', 'code' => 'ResourceGroupNotFound' }) }
20
27
  @gateway_connections.stub :get, response do
21
28
  assert !@service.check_vnet_gateway_connection_exists('fog-test-rg', 'fog-test-gateway-connection')
22
29
  end
23
30
  end
24
31
 
25
32
  def test_check_vnet_gateway_connection_exists_exception
26
- response = proc { raise MsRestAzure::AzureOperationError.new(nil, nil, 'error' => { 'message' => 'mocked exception', 'code' => 'ResourceGroupNotFound' }) }
33
+ response = proc { raise MsRestAzure::AzureOperationError.new(nil, create_mock_response, 'error' => { 'message' => 'mocked exception', 'code' => 'Exception' }) }
27
34
  @gateway_connections.stub :get, response do
28
35
  assert_raises(RuntimeError) { @service.check_vnet_gateway_connection_exists('fog-test-rg', 'fog-test-gateway-connection') }
29
36
  end
@@ -16,14 +16,21 @@ class TestCheckVirtualNetworkGatewayExists < Minitest::Test
16
16
  end
17
17
 
18
18
  def test_check_vnet_gateway_exists_failure
19
- response = proc { raise MsRestAzure::AzureOperationError.new(nil, nil, 'error' => { 'message' => 'mocked exception', 'code' => 'ResourceNotFound' }) }
19
+ response = proc { raise MsRestAzure::AzureOperationError.new(nil, create_mock_response, 'error' => { 'message' => 'mocked exception', 'code' => 'ResourceNotFound' }) }
20
+ @network_gateways.stub :get, response do
21
+ assert !@service.check_vnet_gateway_exists('fog-test-rg', 'fog-test-network-gateway')
22
+ end
23
+ end
24
+
25
+ def test_check_vnet_gateway_resource_group_exists_failure
26
+ response = proc { raise MsRestAzure::AzureOperationError.new(nil, create_mock_response, 'error' => { 'message' => 'mocked exception', 'code' => 'ResourceGroupNotFound' }) }
20
27
  @network_gateways.stub :get, response do
21
28
  assert !@service.check_vnet_gateway_exists('fog-test-rg', 'fog-test-network-gateway')
22
29
  end
23
30
  end
24
31
 
25
32
  def test_check_vnet_gateway_exists_exception
26
- response = proc { raise MsRestAzure::AzureOperationError.new(nil, nil, 'error' => { 'message' => 'mocked exception', 'code' => 'ResourceGroupNotFound' }) }
33
+ response = proc { raise MsRestAzure::AzureOperationError.new(nil, create_mock_response, 'error' => { 'message' => 'mocked exception', 'code' => 'Exception' }) }
27
34
  @network_gateways.stub :get, response do
28
35
  assert_raises(RuntimeError) { @service.check_vnet_gateway_exists('fog-test-rg', 'fog-test-network-gateway') }
29
36
  end
@@ -6,6 +6,7 @@ class TestCreateLoadBalancer < Minitest::Test
6
6
  @service = Fog::Network::AzureRM.new(credentials)
7
7
  @network_client = @service.instance_variable_get(:@network_client)
8
8
  @load_balancers = @network_client.load_balancers
9
+ @tags = { key: 'value' }
9
10
  end
10
11
 
11
12
  def test_create_load_balancer_success
@@ -18,7 +19,7 @@ class TestCreateLoadBalancer < Minitest::Test
18
19
  inbound_nat_rule = ApiStub::Requests::Network::LoadBalancer.inbound_nat_rule
19
20
  inbound_nat_pool = ApiStub::Requests::Network::LoadBalancer.inbound_nat_pool
20
21
  @load_balancers.stub :create_or_update, mocked_response do
21
- assert_equal @service.create_load_balancer('mylb1', 'North US', 'testRG', frontend_ip_config, backend_address_pool, load_balancing_rule, probe, inbound_nat_rule, inbound_nat_pool), mocked_response
22
+ assert_equal @service.create_load_balancer('mylb1', 'North US', 'testRG', frontend_ip_config, backend_address_pool, load_balancing_rule, probe, inbound_nat_rule, inbound_nat_pool, @tags), mocked_response
22
23
  end
23
24
  end
24
25
 
@@ -42,7 +43,7 @@ class TestCreateLoadBalancer < Minitest::Test
42
43
  inbound_nat_pool = ApiStub::Requests::Network::LoadBalancer.inbound_nat_pool
43
44
  @load_balancers.stub :create_or_update, response do
44
45
  assert_raises RuntimeError do
45
- @service.create_load_balancer('mylb1', 'North US', 'testRG', frontend_ip_config, backend_address_pool, load_balancing_rule, probe, inbound_nat_rule, inbound_nat_pool)
46
+ @service.create_load_balancer('mylb1', 'North US', 'testRG', frontend_ip_config, backend_address_pool, load_balancing_rule, probe, inbound_nat_rule, inbound_nat_pool, @tags)
46
47
  end
47
48
  end
48
49
  end
@@ -6,19 +6,20 @@ class TestCreateNetworkInterface < Minitest::Test
6
6
  @service = Fog::Network::AzureRM.new(credentials)
7
7
  @network_client = @service.instance_variable_get(:@network_client)
8
8
  @network_interfaces = @network_client.network_interfaces
9
+ @tags = { key: 'value' }
9
10
  end
10
11
 
11
12
  def test_create_network_interface_success
12
13
  mocked_response = ApiStub::Requests::Network::NetworkInterface.create_network_interface_response(@network_client)
13
14
  @network_interfaces.stub :create_or_update, mocked_response do
14
- assert_equal @service.create_or_update_network_interface('fog-test-rg', 'fog-test-network-interface', 'West US', 'fog-test-subnet-id', 'fog-test-ip-address-id', 'fog-test-nsg-id', 'fog-test-ip-configuration', 'Dynamic', '10.0.0.8', ['id-1', 'id-2'], ['id-1', 'id-2']), mocked_response
15
+ assert_equal @service.create_or_update_network_interface('fog-test-rg', 'fog-test-network-interface', 'West US', 'fog-test-subnet-id', 'fog-test-ip-address-id', 'fog-test-nsg-id', 'fog-test-ip-configuration', 'Dynamic', '10.0.0.8', ['id-1', 'id-2'], ['id-1', 'id-2'], @tags), mocked_response
15
16
  end
16
17
  end
17
18
 
18
19
  def test_create_network_interface_without_public_ip_success
19
20
  mocked_response = ApiStub::Requests::Network::NetworkInterface.create_network_interface_response(@network_client)
20
21
  @network_interfaces.stub :create_or_update, mocked_response do
21
- assert_equal @service.create_or_update_network_interface('fog-test-rg', 'fog-test-network-interface', 'West US', 'fog-test-subnet-id', nil, 'fog-test-nsg-id', 'fog-test-ip-configuration', 'Dynamic', '10.0.0.8', ['id-1', 'id-2'], ['id-1', 'id-2']), mocked_response
22
+ assert_equal @service.create_or_update_network_interface('fog-test-rg', 'fog-test-network-interface', 'West US', 'fog-test-subnet-id', nil, 'fog-test-nsg-id', 'fog-test-ip-configuration', 'Dynamic', '10.0.0.8', ['id-1', 'id-2'], ['id-1', 'id-2'], @tags), mocked_response
22
23
  end
23
24
  end
24
25
 
@@ -35,7 +36,7 @@ class TestCreateNetworkInterface < Minitest::Test
35
36
  response = proc { raise MsRestAzure::AzureOperationError.new(nil, nil, 'error' => { 'message' => 'mocked exception' }) }
36
37
  @network_interfaces.stub :create_or_update, response do
37
38
  assert_raises RuntimeError do
38
- @service.create_or_update_network_interface('fog-test-rg', 'fog-test-network-interface', 'West US', 'fog-test-subnet-id', 'fog-test-ip-address-id', 'fog-test-nsg-id', 'fog-test-ip-configuration', 'Dynamic', '10.0.0.8', ['id-1', 'id-2'], ['id-1', 'id-2'])
39
+ @service.create_or_update_network_interface('fog-test-rg', 'fog-test-network-interface', 'West US', 'fog-test-subnet-id', 'fog-test-ip-address-id', 'fog-test-nsg-id', 'fog-test-ip-configuration', 'Dynamic', '10.0.0.8', ['id-1', 'id-2'], ['id-1', 'id-2'], @tags)
39
40
  end
40
41
  end
41
42
  end
@@ -6,6 +6,7 @@ class TestCreateOrUpdateNetworkSecurityGroup < Minitest::Test
6
6
  @service = Fog::Network::AzureRM.new(credentials)
7
7
  @client = @service.instance_variable_get(:@network_client)
8
8
  @network_security_groups = @client.network_security_groups
9
+ @tags = { key: 'value' }
9
10
  end
10
11
 
11
12
  def test_create_or_update_network_security_group_success
@@ -23,7 +24,7 @@ class TestCreateOrUpdateNetworkSecurityGroup < Minitest::Test
23
24
  description: 'This is a test rule'
24
25
  }
25
26
  @network_security_groups.stub :begin_create_or_update, mocked_response do
26
- assert_equal @service.create_or_update_network_security_group('fog-test-rg', 'fog-test-nsg', 'West US', [security_rule]), mocked_response
27
+ assert_equal @service.create_or_update_network_security_group('fog-test-rg', 'fog-test-nsg', 'West US', [security_rule], @tags), mocked_response
27
28
  end
28
29
  end
29
30
 
@@ -31,7 +32,7 @@ class TestCreateOrUpdateNetworkSecurityGroup < Minitest::Test
31
32
  response = proc { raise MsRestAzure::AzureOperationError.new(nil, nil, 'error' => { 'message' => 'mocked exception' }) }
32
33
  @network_security_groups.stub :begin_create_or_update, response do
33
34
  assert_raises RuntimeError do
34
- @service.create_or_update_network_security_group('fog-test-rg', 'fog-test-nsg', 'West US', [])
35
+ @service.create_or_update_network_security_group('fog-test-rg', 'fog-test-nsg', 'West US', [], @tags)
35
36
  end
36
37
  end
37
38
  end
@@ -15,13 +15,15 @@ class TestCreateOrUpdatevirtualNetwork < Minitest::Test
15
15
  network_security_group_id: 'nsg-id',
16
16
  route_table_id: 'nsg-id'
17
17
  }]
18
+
19
+ @tags = { key: 'value' }
18
20
  end
19
21
 
20
22
  def test_create_or_update_virtual_network_success
21
23
  mocked_response = ApiStub::Requests::Network::VirtualNetwork.create_virtual_network_response(@network_client)
22
24
 
23
25
  @virtual_networks.stub :create_or_update, mocked_response do
24
- assert_equal @service.create_or_update_virtual_network('fog-test-rg', 'fog-test-virtual-network', 'westus', ['10.1.0.5', '10.1.0.6'], @subnets, ['10.1.0.0/16', '10.2.0.0/16']), mocked_response
26
+ assert_equal @service.create_or_update_virtual_network('fog-test-rg', 'fog-test-virtual-network', 'westus', ['10.1.0.5', '10.1.0.6'], @subnets, ['10.1.0.0/16', '10.2.0.0/16'], @tags), mocked_response
25
27
  end
26
28
  end
27
29
 
@@ -29,7 +31,7 @@ class TestCreateOrUpdatevirtualNetwork < Minitest::Test
29
31
  mocked_response = ApiStub::Requests::Network::VirtualNetwork.create_virtual_network_response(@network_client)
30
32
 
31
33
  @virtual_networks.stub :create_or_update, mocked_response do
32
- assert_equal @service.create_or_update_virtual_network('fog-test-rg', 'fog-test-virtual-network', 'westus', ['10.1.0.5', '10.1.0.6'], @subnets, nil), mocked_response
34
+ assert_equal @service.create_or_update_virtual_network('fog-test-rg', 'fog-test-virtual-network', 'westus', ['10.1.0.5', '10.1.0.6'], @subnets, nil, @tags), mocked_response
33
35
  end
34
36
  end
35
37
 
@@ -48,7 +50,7 @@ class TestCreateOrUpdatevirtualNetwork < Minitest::Test
48
50
 
49
51
  @virtual_networks.stub :create_or_update, response do
50
52
  assert_raises RuntimeError do
51
- @service.create_or_update_virtual_network('fog-test-rg', 'fog-test-virtual-network', 'westus', ['10.1.0.5', '10.1.0.6'], @subnets, ['10.1.0.0/16', '10.2.0.0/16'])
53
+ @service.create_or_update_virtual_network('fog-test-rg', 'fog-test-virtual-network', 'westus', ['10.1.0.5', '10.1.0.6'], @subnets, ['10.1.0.0/16', '10.2.0.0/16'], @tags)
52
54
  end
53
55
  end
54
56
  end
@@ -6,12 +6,13 @@ class TestCreatePublicIp < Minitest::Test
6
6
  @service = Fog::Network::AzureRM.new(credentials)
7
7
  @network_client = @service.instance_variable_get(:@network_client)
8
8
  @public_ips = @network_client.public_ipaddresses
9
+ @tags = { key: 'value' }
9
10
  end
10
11
 
11
12
  def test_create_public_ip_success
12
13
  mocked_response = ApiStub::Requests::Network::PublicIp.create_public_ip_response(@network_client)
13
14
  @public_ips.stub :create_or_update, mocked_response do
14
- assert_equal @service.create_or_update_public_ip('fog-test-rg', 'fog-test-public-ip', 'West US', 'Dynamic', '', ''), mocked_response
15
+ assert_equal @service.create_or_update_public_ip('fog-test-rg', 'fog-test-public-ip', 'West US', 'Dynamic', '', '', @tags), mocked_response
15
16
  end
16
17
  end
17
18
 
@@ -28,7 +29,7 @@ class TestCreatePublicIp < Minitest::Test
28
29
  response = proc { raise MsRestAzure::AzureOperationError.new(nil, nil, 'error' => { 'message' => 'mocked exception' }) }
29
30
  @public_ips.stub :create_or_update, response do
30
31
  assert_raises RuntimeError do
31
- @service.create_or_update_public_ip('fog-test-rg', 'fog-test-public-ip', 'West US', 'Dynamic', '', '')
32
+ @service.create_or_update_public_ip('fog-test-rg', 'fog-test-public-ip', 'West US', 'Dynamic', '', '', @tags)
32
33
  end
33
34
  end
34
35
  end
@@ -7,11 +7,12 @@ class TestUpdatePublicIp < Minitest::Test
7
7
  network_client = @service.instance_variable_get(:@network_client)
8
8
  @public_ips = network_client.public_ipaddresses
9
9
  @response = ApiStub::Requests::Network::PublicIp.create_public_ip_response(network_client)
10
+ @tags = { key: 'value' }
10
11
  end
11
12
 
12
13
  def test_update_public_ip_success
13
14
  @public_ips.stub :create_or_update, @response do
14
- assert_equal @service.create_or_update_public_ip('TestRG', 'testPubIp432', 'West US', 'Dynamic', '4', 'mylabel'), @response
15
+ assert_equal @service.create_or_update_public_ip('TestRG', 'testPubIp432', 'West US', 'Dynamic', '4', 'mylabel', @tags), @response
15
16
  end
16
17
  end
17
18
 
@@ -27,7 +28,7 @@ class TestUpdatePublicIp < Minitest::Test
27
28
  response = proc { raise MsRestAzure::AzureOperationError.new(nil, nil, 'error' => { 'message' => 'mocked exception' }) }
28
29
  @public_ips.stub :create_or_update, response do
29
30
  assert_raises RuntimeError do
30
- @service.create_or_update_public_ip('fog-test-rg', 'fog-test-public-ip', 'West US', 'Dynamic', '4', 'mylabel')
31
+ @service.create_or_update_public_ip('fog-test-rg', 'fog-test-public-ip', 'West US', 'Dynamic', '4', 'mylabel', @tags)
31
32
  end
32
33
  end
33
34
  end
@@ -6,19 +6,20 @@ class TestCreateResourceGroup < Minitest::Test
6
6
  @service = Fog::Resources::AzureRM.new(credentials)
7
7
  @client = @service.instance_variable_get(:@rmc)
8
8
  @resource_groups = @client.resource_groups
9
+ @tags = { tagkey1: 'tagvalue1' }
9
10
  end
10
11
 
11
12
  def test_create_resource_group_success
12
13
  mocked_response = ApiStub::Requests::Resources::ResourceGroup.create_resource_group_response(@client)
13
14
  @resource_groups.stub :create_or_update, mocked_response do
14
- assert_equal @service.create_resource_group('fog-test-rg', 'west us'), mocked_response
15
+ assert_equal @service.create_resource_group('fog-test-rg', 'west us', @tags), mocked_response
15
16
  end
16
17
  end
17
18
 
18
19
  def test_create_resource_group_failure
19
20
  response = proc { raise MsRestAzure::AzureOperationError.new(nil, nil, 'error' => { 'message' => 'mocked exception' }) }
20
21
  @resource_groups.stub :create_or_update, response do
21
- assert_raises(RuntimeError) { @service.create_resource_group('fog-test-rg', 'west us') }
22
+ assert_raises(RuntimeError) { @service.create_resource_group('fog-test-rg', 'west us', @tags) }
22
23
  end
23
24
  end
24
25
  end
@@ -13,7 +13,7 @@ class TestDeleteResourceTag < Minitest::Test
13
13
  @resources.stub :get, @resource_response do
14
14
  @resources.stub :create_or_update, @resource_response do
15
15
  resource_id = '/subscriptions/########-####-####-####-############/resourceGroups/{RESOURCE-GROUP}/providers/Microsoft.Network/{PROVIDER-NAME}/{RESOURCE-NAME}'
16
- assert @service.delete_resource_tag(resource_id, 'tag_name', 'tag_value')
16
+ assert @service.delete_resource_tag(resource_id, 'tag_name', 'tag_value', 'api_version')
17
17
  end
18
18
  end
19
19
  end
@@ -23,13 +23,13 @@ class TestDeleteResourceTag < Minitest::Test
23
23
  @resources.stub :get, @resource_response do
24
24
  @resources.stub :create_or_update, response do
25
25
  resource_id = '/subscriptions/########-####-####-####-############/resourceGroups/{RESOURCE-GROUP}/providers/Microsoft.Network/{PROVIDER-NAME}/{RESOURCE-NAME}'
26
- assert_raises(RuntimeError) { @service.delete_resource_tag(resource_id, 'tag_name', 'tag_value') }
26
+ assert_raises(RuntimeError) { @service.delete_resource_tag(resource_id, 'tag_name', 'tag_value', 'api_version') }
27
27
  end
28
28
  end
29
29
  end
30
30
 
31
31
  def test_invalid_resource_id_exeception
32
32
  resource_id = 'Invalid-Resource-ID'
33
- assert_raises(RuntimeError) { @service.delete_resource_tag(resource_id, 'tag_name', 'tag_value') }
33
+ assert_raises(RuntimeError) { @service.delete_resource_tag(resource_id, 'tag_name', 'tag_value', 'api_version') }
34
34
  end
35
35
  end