Sha256: cb56703c68dddf33ea5f2e61ee4939ea2286a1df3ceb13eee0aea8ee1be0d438

Contents?: true

Size: 1.09 KB

Versions: 47

Compression:

Stored size: 1.09 KB

Contents

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

# Storage Blob Class
class TestGetBlobHttpsUrl < 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
    @token = ApiStub::Requests::Storage::File.blob_url_token
  end

  def test_get_blob_https_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_https_url('test_container', 'test_blob', Time.now.utc + 3600)
      end
    end
  end

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

Version data entries

47 entries across 47 versions & 4 rubygems

Version Path
fog-azure-rm-0.4.1 test/requests/storage/test_get_blob_https_url.rb
fog-azure-rm-0.4.0 test/requests/storage/test_get_blob_https_url.rb
fog-azure-rm-0.3.9 test/requests/storage/test_get_blob_https_url.rb
fog-azure-rm-0.3.8 test/requests/storage/test_get_blob_https_url.rb
fog-azure-rm-0.3.7 test/requests/storage/test_get_blob_https_url.rb
fog-azure-rm-0.3.6 test/requests/storage/test_get_blob_https_url.rb
fog-azure-rm-0.3.5 test/requests/storage/test_get_blob_https_url.rb
fog-azure-rm-0.3.4 test/requests/storage/test_get_blob_https_url.rb
fog-azure-rm-temp-0.0.4 test/requests/storage/test_get_blob_https_url.rb
fog-azure-rm-temp-0.0.3 test/requests/storage/test_get_blob_https_url.rb
fog-azure-rm-0.3.3 test/requests/storage/test_get_blob_https_url.rb
fog-azure-rm-temp-0.0.2 test/requests/storage/test_get_blob_https_url.rb
fog-azure-rm-temp-0.0.1 test/requests/storage/test_get_blob_https_url.rb
fog-azure-rm-0.3.2 test/requests/storage/test_get_blob_https_url.rb
fog-azure-rm-downgraded-0.3.1 test/requests/storage/test_get_blob_https_url.rb
fog-azure-rm-0.3.1 test/requests/storage/test_get_blob_https_url.rb
fog-azure-rm-downgraded-0.3.0 test/requests/storage/test_get_blob_https_url.rb
fog-azure-rm-0.3.0 test/requests/storage/test_get_blob_https_url.rb
fog-azure-rm-0.2.7 test/requests/storage/test_get_blob_https_url.rb
fog-azure-rm-0.2.6 test/requests/storage/test_get_blob_https_url.rb