Sha256: e66e8f32707a48ef732d0bab03fe1f2569525655b5bf23acaf4272709220335a

Contents?: true

Size: 1.27 KB

Versions: 3

Compression:

Stored size: 1.27 KB

Contents

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

# Storage Container Class
class TestGetContainerProperties < Minitest::Test
  # This class posesses the test cases for the requests of getting storage container properties.
  def setup
    @service = Fog::Storage::AzureRM.new(storage_account_credentials)
    @blob_client = @service.instance_variable_get(:@blob_client)
    @storage_container_object = ApiStub::Requests::Storage::Directory.get_container_properties
  end

  def test_get_container_properties_with_service_success
    @blob_client.stub :get_container_properties, @storage_container_object do
      assert @service.get_container_properties('testcontainer1')
    end
  end

  def test_get_container_properties_with_internal_client_success
    @blob_client.stub :get_container_properties, @storage_container_object do
      assert @blob_client.get_container_properties('testcontainer1')
    end
  end

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

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

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
fog-azure-rm-0.1.0 test/requests/storage/test_get_container_properties.rb
fog-azure-rm-0.0.9 test/requests/storage/test_get_container_properties.rb
fog-azure-rm-0.0.8 test/requests/storage/test_get_container_properties.rb