Sha256: c00339d27bcfbfa806323daed2a0ebd708bab0b22bd7a0def3ab2c0cbe56d045

Contents?: true

Size: 1.04 KB

Versions: 3

Compression:

Stored size: 1.04 KB

Contents

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

# Storage Container Class
class TestDeleteContaienr < Minitest::Test
  # This class posesses the test cases for the requests of deleting storage containers.
  def setup
    @service = Fog::Storage::AzureRM.new(storage_account_credentials)
    @blob_client = @service.instance_variable_get(:@blob_client)
  end

  def test_delete_container_with_service_success
    @blob_client.stub :delete_container, true do
      assert @service.delete_container('testcontainer1')
    end
  end

  def test_delete_container_with_internal_client_success
    @blob_client.stub :delete_container, true do
      assert @blob_client.delete_container('testcontainer1')
    end
  end

  def test_delete_container_with_service_exception
    assert_raises(URI::InvalidURIError) { @service.delete_container('testcontainer1#@#@') }
  end

  def test_delete_container_with_internal_client_exception
    assert_raises(URI::InvalidURIError) { @blob_client.delete_container('testcontainer1#@#@') }
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
fog-azure-rm-0.0.6 test/requests/storage/test_delete_container.rb
fog-azure-rm-0.0.5 test/requests/storage/test_delete_container.rb
fog-azure-rm-0.0.4 test/requests/storage/test_delete_container.rb