test/models/compute/test_server.rb in fog-azure-rm-0.3.3 vs test/models/compute/test_server.rb in fog-azure-rm-0.3.4
- old
+ new
@@ -18,11 +18,13 @@
:restart,
:deallocate,
:redeploy,
:list_available_sizes,
:attach_data_disk,
- :detach_data_disk
+ :detach_data_disk,
+ :attach_managed_disk,
+ :detach_managed_disk
]
methods.each do |method|
assert_respond_to @server, method
end
end
@@ -50,11 +52,14 @@
:ssh_key_data,
:platform,
:provision_vm_agent,
:enable_automatic_updates,
:network_interface_card_ids,
- :availability_set_id
+ :availability_set_id,
+ :managed_disk_storage_type,
+ :os_disk_size,
+ :tags
]
attributes.each do |attribute|
assert_respond_to @server, attribute
end
end
@@ -194,8 +199,32 @@
end
async_response = Concurrent::Promise.execute { 10 }
@service.stub :detach_data_disk_from_vm, async_response do
assert_instance_of Fog::AzureRM::AsyncResponse, @server.detach_data_disk('disk1', true)
+ end
+ end
+
+ def test_attach_managed_disk_response
+ response = ApiStub::Models::Compute::Server.attach_managed_disk_response(@compute_client)
+ @service.stub :attach_data_disk_to_vm, response do
+ assert_instance_of Fog::Compute::AzureRM::Server, @server.attach_managed_disk('disk_name', 'resoure_group')
+ end
+
+ async_response = Concurrent::Promise.execute { 10 }
+ @service.stub :attach_data_disk_to_vm, async_response do
+ assert_instance_of Fog::AzureRM::AsyncResponse, @server.attach_managed_disk('managed_disk_name', 'resoure_group', true)
+ end
+ end
+
+ def test_detach_managed_disk_response
+ response = ApiStub::Models::Compute::Server.create_linux_virtual_machine_response(@compute_client)
+ @service.stub :detach_data_disk_from_vm, response do
+ assert_instance_of Fog::Compute::AzureRM::Server, @server.detach_managed_disk('managed_disk_name')
+ end
+
+ async_response = Concurrent::Promise.execute { 10 }
+ @service.stub :detach_data_disk_from_vm, async_response do
+ assert_instance_of Fog::AzureRM::AsyncResponse, @server.detach_managed_disk('managed_disk_name', true)
end
end
end