Sha256: c680d56ae69428660421e3cb93d1f3e0d9c44a28e646591d123ea48a81abd061

Contents?: true

Size: 1.1 KB

Versions: 62

Compression:

Stored size: 1.1 KB

Contents

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

# Storage Container Class
class TestGetContainerUrl < Minitest::Test
  # This class posesses the test cases for the requests of getting storage container url.
  def setup
    Fog.mock!
    @mock_service = Fog::Storage::AzureRM.new(storage_account_credentials)
    Fog.unmock!

    @service = Fog::Storage::AzureRM.new(storage_account_credentials)
    @blob_client = @service.instance_variable_get(:@blob_client)

    @url = ApiStub::Requests::Storage::Directory.container_https_url
  end

  def test_get_container_url_success
    @blob_client.stub :generate_uri, @url do
      assert_equal @url, @service.get_container_url('test_container')

      options = { scheme: 'http' }
      assert_equal @url.gsub('https:', 'http:'), @service.get_container_url('test_container', options)
    end
  end

  def test_get_container_url_mock
    assert_equal @url, @mock_service.get_container_url('test_container')

    options = { scheme: 'http' }
    http_url = @url.gsub('https:', 'http:')
    assert_equal http_url, @mock_service.get_container_url('test_container', options)
  end
end

Version data entries

62 entries across 62 versions & 5 rubygems

Version Path
gitlab-fog-azure-rm-1.8.0 test/requests/storage/test_get_container_url.rb
gitlab-fog-azure-rm-1.7.0 test/requests/storage/test_get_container_url.rb
gitlab-fog-azure-rm-1.6.0 test/requests/storage/test_get_container_url.rb
gitlab-fog-azure-rm-1.5.0 test/requests/storage/test_get_container_url.rb
gitlab-fog-azure-rm-1.4.0 test/requests/storage/test_get_container_url.rb
gitlab-fog-azure-rm-1.3.0 test/requests/storage/test_get_container_url.rb
fog-azure-rm-0.6.0 test/requests/storage/test_get_container_url.rb
gitlab-fog-azure-rm-1.2.0 test/requests/storage/test_get_container_url.rb
gitlab-fog-azure-rm-1.1.1 test/requests/storage/test_get_container_url.rb
gitlab-fog-azure-rm-1.0.1 test/requests/storage/test_get_container_url.rb
gitlab-fog-azure-rm-1.0.0 test/requests/storage/test_get_container_url.rb
gitlab-fog-azure-rm-0.9.0 test/requests/storage/test_get_container_url.rb
gitlab-fog-azure-rm-0.8.1 test/requests/storage/test_get_container_url.rb
gitlab-fog-azure-rm-0.8.0 test/requests/storage/test_get_container_url.rb
gitlab-fog-azure-rm-0.7.0 test/requests/storage/test_get_container_url.rb
gitlab-fog-azure-rm-0.6.0 test/requests/storage/test_get_container_url.rb
fog-azure-rm-0.5.3 test/requests/storage/test_get_container_url.rb
fog-azure-rm-0.5.2 test/requests/storage/test_get_container_url.rb
far-gem-0.5.6 test/requests/storage/test_get_container_url.rb
fog-azure-rm-0.5.1 test/requests/storage/test_get_container_url.rb