Sha256: 7d7ed89ecf00d0379e55d869974af2633c933cae8548313d14776d3de703bd10

Contents?: true

Size: 1.27 KB

Versions: 1

Compression:

Stored size: 1.27 KB

Contents

require File.dirname(__FILE__) + '/../s3_test_constants'
require_gem 'FakeWeb'

class TestClient < Test::Unit::TestCase
  def setup
    @client = Client.new(S3Testing::ACCESS_KEY, S3Testing::SECRET_ACCESS_KEY, :ssl => false)
    @client2 = Client.new(S3Testing::ACCESS_KEY, S3Testing::SECRET_ACCESS_KEY)
    @bucket = 'testingtesting'
    @url = url_join('http://', HOST, @bucket)
    FakeWeb.register_uri(@url, :status => 200)
  end

  def test_returns_ssl_setting_correctly
    assert !(@client.use_ssl?)
    assert @client2.use_ssl?
  end

  def test_catches_max_keys_too_high_in_bucket_listing_request
    assert_raise(S3Exception::BucketListingMaxKeysError) do
      @client.list_bucket('duff', :max_keys => (S3::BUCKET_LIST_MAX_MAX_KEYS + 1))
    end
  end

  def test_fetches_bucket_listing_ok
    resp = @client.list_bucket(@bucket)
    assert resp.ok?
  end

  def test_recursively_put_files_into_bucket_with_paths_as_keys
    flunk 'Test conversion of paths to keys'
  end

  def test_has_attached_bucket_listing_object_for_get_on_bucket
    flunk 'Check that responses to list_bucket have an attached BucketListing instance'
  end
  
  def test_keys_dont_have_leading_slashes_stripped_when_putting_resources
    flunk 'Keys with leading slashes should not have the slash stripped'
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
s33r-0.2 test/cases/unit_client.rb