Sha256: b2d409d2cbd0f13bac5359ce0a05d803df7c2f71e24ef66b49f946ca16837a9b

Contents?: true

Size: 1.11 KB

Versions: 54

Compression:

Stored size: 1.11 KB

Contents

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

# Storage Blob Class
class TestGetBlobHttpUrl < Minitest::Test
  # This class posesses the test cases for the requests of Blob service.
  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)
    @signature_client = @service.instance_variable_get(:@signature_client)

    @url = ApiStub::Requests::Storage::File.blob_https_url.gsub('https:', 'http:')
    @token = ApiStub::Requests::Storage::File.blob_url_token
  end

  def test_get_blob_http_url_success
    @blob_client.stub :generate_uri, @url do
      @signature_client.stub :generate_service_sas_token, @token do
        assert_equal "#{@url}?#{@token}", @service.get_blob_http_url('test_container', 'test_blob', Time.now.utc + 3600)
      end
    end
  end

  def test_get_blob_http_url_mock
    assert_equal "#{@url}?#{@token}", @mock_service.get_blob_http_url('test_container', 'test_blob', Time.now.utc + 3600)
  end
end

Version data entries

54 entries across 54 versions & 5 rubygems

Version Path
fog-azure-rm-0.6.0 test/requests/storage/test_get_blob_http_url.rb
gitlab-fog-azure-rm-1.0.1 test/requests/storage/test_get_blob_http_url.rb
gitlab-fog-azure-rm-1.0.0 test/requests/storage/test_get_blob_http_url.rb
gitlab-fog-azure-rm-0.9.0 test/requests/storage/test_get_blob_http_url.rb
gitlab-fog-azure-rm-0.8.1 test/requests/storage/test_get_blob_http_url.rb
gitlab-fog-azure-rm-0.8.0 test/requests/storage/test_get_blob_http_url.rb
gitlab-fog-azure-rm-0.7.0 test/requests/storage/test_get_blob_http_url.rb
gitlab-fog-azure-rm-0.6.0 test/requests/storage/test_get_blob_http_url.rb
fog-azure-rm-0.5.3 test/requests/storage/test_get_blob_http_url.rb
fog-azure-rm-0.5.2 test/requests/storage/test_get_blob_http_url.rb
far-gem-0.5.6 test/requests/storage/test_get_blob_http_url.rb
fog-azure-rm-0.5.1 test/requests/storage/test_get_blob_http_url.rb
far-gem-0.5.5 test/requests/storage/test_get_blob_http_url.rb
fog-azure-rm-0.5.0 test/requests/storage/test_get_blob_http_url.rb
far-gem-0.5.4 test/requests/storage/test_get_blob_http_url.rb
far-gem-0.5.3 test/requests/storage/test_get_blob_http_url.rb
fog-azure-rm-0.4.9 test/requests/storage/test_get_blob_http_url.rb
far-gem-0.5.2 test/requests/storage/test_get_blob_http_url.rb
fog-azure-rm-0.4.8 test/requests/storage/test_get_blob_http_url.rb
fog-azure-rm-0.4.7 test/requests/storage/test_get_blob_http_url.rb