'Test our file deployment
- Uploaded
- Have the correct name
- Compressed (if useful) -- #TODO
- Publicly readable'

def test_simple_deploy(self):

    bucket_name = self.site.config.get(u'aws-bucket-name')
    payload = ((u'\x01' * 1000) + (u'\x02' * 1000))
    payload = payload.encode(u'utf-8')
    with io.FileIO(os.path.join(self.site.static_path, u'static.css'), u'w') as f:
        f.write(payload)
    self.site.upload()
    puts = [req for req in self.connection_factory.requests if (req.method == u'PUT')]
    self.assertEqual(1, len(puts))
    put = puts[0]
    self.assertEqual(u'/{0}/static/static.css'.format(bucket_name), put.url)
    self.assertEqual(u'public-read', put.headers[u'x-amz-acl'])
    self.assertEqual(u'gzip', put.headers[u'content-encoding'])
    self.assertEqual(u'max-age={0}'.format(BaseFile.DEFAULT_CACHE_EXPIRATION), put.headers[u'cache-control'])
    self.assertEqual(u'AWS    123', put.headers[u'authorization'].split(u':')[0])
    self.assertEqual(u's3.amazonaws.com', put.connection.host)
    compressed = gzip.GzipFile(fileobj=BytesIO(put.body), mode=u'r')
    self.assertEqual(payload, compressed.read())
