'Call ``publish_docs`` and assert that only the expected buckets have an
updated error_key property.
:param unicode doc_version: The version of the documentation that is
being published.
:param NamedConstant environment: One of the ``NamedConstants`` in
``Environments``.
:param bool should_update: A flag indicating whether the error_key for
the bucket associated with ``environment`` is expected to be
updated.
:raises: ``FailTest`` if an error_key in any of the S3 buckets has been
updated unexpectedly.'

def assert_error_key_update(self, doc_version, environment, should_update):

    bucket_names = set()
    for e in Environments.iterconstants():
        bucket_names.add(DOCUMENTATION_CONFIGURATIONS[e].documentation_bucket)
    empty_buckets = {bucket_name: {} for bucket_name in bucket_names}
    empty_buckets['clusterhq-staging-docs'] = {}
    empty_error_keys = {bucket_name: '' for bucket_name in bucket_names}
    aws = FakeAWS(routing_rules={}, s3_buckets=empty_buckets, error_key=empty_error_keys)
    expected_error_path = 'en/{}/error_pages/404.html'.format(doc_version)
    expected_updated_bucket = DOCUMENTATION_CONFIGURATIONS[environment].documentation_bucket
    expected_error_keys = aws.error_key.copy()
    if should_update:
        expected_error_keys[expected_updated_bucket] = expected_error_path
    self.publish_docs(aws, flocker_version=doc_version, doc_version=doc_version, environment=environment)
    self.assertEqual(expected_error_keys, aws.error_key)
