Sha256: b19e4d804fd6a6b7745f7742de0e52d592a993a76b864387b072da0f49072cb7
Contents?: true
Size: 1.65 KB
Versions: 14
Compression:
Stored size: 1.65 KB
Contents
require File.expand_path '../../test_helper', __dir__ # Test class for Delete Resource Tag Request class TestDeleteResourceTag < Minitest::Test def setup @service = Fog::Resources::AzureRM.new(credentials) @client = @service.instance_variable_get(:@rmc) @resources = @client.resources @resource_response = ApiStub::Requests::Resources::AzureResource.azure_resource_response(@client) end def test_delete_resource_tag_success @resources.stub :get, @resource_response do @resources.stub :create_or_update, @resource_response do resource_id = '/subscriptions/########-####-####-####-############/resourceGroups/{RESOURCE-GROUP}/providers/Microsoft.Network/{PROVIDER-NAME}/{RESOURCE-NAME}' assert @service.delete_resource_tag(resource_id, 'tag_name', 'tag_value', 'api_version') end end end def test_delete_resource_tag_failure response = proc { raise MsRestAzure::AzureOperationError.new(nil, nil, 'error' => { 'message' => 'mocked exception' }) } @resources.stub :get, @resource_response do @resources.stub :create_or_update, response do resource_id = '/subscriptions/########-####-####-####-############/resourceGroups/{RESOURCE-GROUP}/providers/Microsoft.Network/{PROVIDER-NAME}/{RESOURCE-NAME}' assert_raises(MsRestAzure::AzureOperationError) { @service.delete_resource_tag(resource_id, 'tag_name', 'tag_value', 'api_version') } end end end def test_invalid_resource_id_exeception resource_id = 'Invalid-Resource-ID' assert_raises(RuntimeError) { @service.delete_resource_tag(resource_id, 'tag_name', 'tag_value', 'api_version') } end end
Version data entries
14 entries across 14 versions & 2 rubygems