Skip to content
Browse files

Added test for streaming a key download via bucket.

  • Loading branch information...
1 parent 87941d0 commit b8346ca55159577fbfe5d2fad73934b5eaad26de @NeMO84 committed Jun 15, 2011
Showing with 22 additions and 0 deletions.
  1. +22 −0 test/s3/test_s3_class.rb
View
22 test/s3/test_s3_class.rb
@@ -176,4 +176,26 @@ def test_60_clear_delete
assert bucket.delete(true)
end
+ # No streaming test should be captured in
+ # test_21_bucket_create_put_get_key
+ def test_61_get_bucket_key_via_streaming
+ bucket = Aws::S3::Bucket.create(@s, @bucket, true)
+ # check that the bucket exists
+ assert @s.buckets.map { |b| b.name }.include?(@bucket)
+ # put data
+ assert bucket.put(@key2, RIGHT_OBJECT_TEXT, {'family'=>'123456_61'})
+ # get data and compare via streaming
+ # stream data from S3
+ data = ""
+ bucket.get(@key2) do |chunk|
+ data += chunk
+ end
+ assert_equal RIGHT_OBJECT_TEXT, data
+ # get key object
+ key = bucket.key(@key2, true)
+ assert_equal Aws::S3::Key, key.class
+ assert key.exists?
+ assert_equal '123456_61', key.meta_headers['family']
+ end
+
end

0 comments on commit b8346ca

Please sign in to comment.
Something went wrong with that request. Please try again.