'A content type can be set for an uploaded file.'

@if_aws
def test_upload_content_type(self):

    filename = random_name(self)
    tmpdir = FilePath(self.mktemp())
    tmpdir.makedirs()
    tmpfile = tmpdir.child(filename)
    tmpfile.setContent('foo')
    s3 = boto.connect_s3()
    bucket = s3.get_bucket(bucket_name)
    self.addCleanup(bucket.delete_key, filename)
    sync_perform(dispatcher=ComposedDispatcher([boto_dispatcher, base_dispatcher]), effect=Effect(UploadToS3(source_path=tmpdir, target_bucket=bucket_name, target_key=filename, file=tmpfile, content_type='application/json')))
    key = bucket.get_key(filename)
    self.assertEqual('application/json', key.content_type)
