From bb3f214369ac5e654ef3afc99419f1fd02f11de0 Mon Sep 17 00:00:00 2001 From: Stephon Striplin Date: Mon, 11 Jul 2011 12:14:06 -0700 Subject: [PATCH] add test_object_set_get_metadata_empty --- test_s3.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/test_s3.py b/test_s3.py index cfe28c5..8c9ae3e 100644 --- a/test_s3.py +++ b/test_s3.py @@ -310,6 +310,17 @@ def test_object_set_get_metadata(): eq(got, 'mymeta') +def test_object_set_get_metadata_empty(): + bucket = get_new_bucket() + key = boto.s3.key.Key(bucket) + key.key = ('foo') + key.set_metadata('meta1', '') + key.set_contents_from_string('bar') + key2 = bucket.get_key('foo') + got = key2.get_metadata('meta1') + eq(got, '') + + # UTF-8 encoded data should pass straight through def test_object_set_get_unicode_metadata(): bucket = get_new_bucket()