'Calling :func:`publish_docs` with a release or documentation version
creates an invalidation for
- en/latest/
- en/<doc_version>/
each for every path in the documentation for version that was
previously `en/latest/`.'

def test_creates_cloudfront_invalidation_previous_version(self):

    aws = FakeAWS(routing_rules={}, s3_buckets={'clusterhq-staging-docs': {'index.html': '', 'en/index.html': '', 'en/latest/index.html': '', 'en/0.3.0/index.html': '', 'en/0.3.0/sub/index.html': '', 'release/flocker-0.3.0+444.gf05215b/index.html': '', 'release/flocker-0.3.0+444.gf05215b/sub/index.html': ''}})
    self.publish_docs(aws, '0.3.0+444.gf05215b', '0.3.1', environment=Environments.STAGING)
    self.assertEqual(aws.cloudfront_invalidations, [CreateCloudFrontInvalidation(cname='docs.staging.clusterhq.com', paths={'en/latest/', 'en/latest/index.html', 'en/latest/sub/', 'en/latest/sub/index.html', 'en/0.3.1/', 'en/0.3.1/index.html', 'en/0.3.1/sub/', 'en/0.3.1/sub/index.html'})])
