'An index file is uploaded to S3.'

def test_index_uploaded(self):

    bucket = 'clusterhq-archive'
    aws = FakeAWS(routing_rules={}, s3_buckets={bucket: {'python/Flocker-0.3.1-py2-none-any.whl': ''}})
    scratch_directory = FilePath(self.mktemp())
    scratch_directory.makedirs()
    sync_perform(ComposedDispatcher([aws.get_dispatcher(), base_dispatcher]), upload_pip_index(scratch_directory=scratch_directory, target_bucket=bucket))
    self.assertEqual(aws.s3_buckets[bucket]['python/index.html'], '<html>\nThis    is    an    index    for    pip\n<div><a    href="Flocker-0.3.1-py2-none-any.whl">Flocker-0.3.1-py2-none-any.whl</a><br    />\n</div></html>')
