Sha256: 28508ee735d20c1ce32bb28291af09150a2660734dce0ed24431bba77c93cf07

Contents?: true

Size: 1.1 KB

Versions: 33

Compression:

Stored size: 1.1 KB

Contents

require File.expand_path '../../test_helper', __dir__

# Test Class for Get Storage Account Request
class TestGetStorageAccount < Minitest::Test
  # This class posesses the test cases for the requests of storage account service.
  def setup
    @service = Fog::Storage::AzureRM.new(credentials)
    @storage_mgmt_client = @service.instance_variable_get(:@storage_mgmt_client)
    @storage_accounts = @storage_mgmt_client.storage_accounts
  end

  def test_get_storage_account_success
    response_body = ApiStub::Requests::Storage::StorageAccount.storage_account_request(@storage_mgmt_client)
    @storage_accounts.stub :get_properties, response_body do
      assert_equal @service.get_storage_account('fog_test_rg', 'fogtestsasecond'), response_body
    end
  end

  def test_list_storage_accounts_exeception
    raise_exception = proc { fail MsRestAzure::AzureOperationError.new(nil, nil, 'error' => { 'message' => 'mocked exception' }) }
    @storage_accounts.stub :get_properties, raise_exception do
      assert_raises(RuntimeError) { @service.get_storage_account('fog_test_rg', 'fogtestsasecond') }
    end
  end
end

Version data entries

33 entries across 33 versions & 4 rubygems

Version Path
fog-azure-rm-0.4.5 test/requests/storage/test_get_storage_account.rb
fog-azure-rm-temp-0.0.5 test/requests/storage/test_get_storage_account.rb
fog-azure-rm-0.4.4 test/requests/storage/test_get_storage_account.rb
fog-azure-rm-0.4.3 test/requests/storage/test_get_storage_account.rb
far-gem-0.5.1 test/requests/storage/test_get_storage_account.rb
fog-azure-rm-0.4.2 test/requests/storage/test_get_storage_account.rb
fog-azure-rm-0.4.1 test/requests/storage/test_get_storage_account.rb
fog-azure-rm-0.4.0 test/requests/storage/test_get_storage_account.rb
fog-azure-rm-0.3.9 test/requests/storage/test_get_storage_account.rb
fog-azure-rm-0.3.8 test/requests/storage/test_get_storage_account.rb
fog-azure-rm-0.3.7 test/requests/storage/test_get_storage_account.rb
fog-azure-rm-0.3.6 test/requests/storage/test_get_storage_account.rb
fog-azure-rm-0.3.5 test/requests/storage/test_get_storage_account.rb
fog-azure-rm-0.3.4 test/requests/storage/test_get_storage_account.rb
fog-azure-rm-temp-0.0.4 test/requests/storage/test_get_storage_account.rb
fog-azure-rm-temp-0.0.3 test/requests/storage/test_get_storage_account.rb
fog-azure-rm-0.3.3 test/requests/storage/test_get_storage_account.rb
fog-azure-rm-temp-0.0.2 test/requests/storage/test_get_storage_account.rb
fog-azure-rm-temp-0.0.1 test/requests/storage/test_get_storage_account.rb
fog-azure-rm-0.3.2 test/requests/storage/test_get_storage_account.rb