#NEWLINE# def assert_error_key_update( self , doc_version , environment , should_update ) : #NEWLINE# #INDENT# '\n        Call ``publish_docs`` and assert that only the expected buckets have an\n        updated error_key property.\n\n        :param unicode doc_version: The version of the documentation that is\n            being published.\n        :param NamedConstant environment: One of the ``NamedConstants`` in\n            ``Environments``.\n        :param bool should_update: A flag indicating whether the error_key for\n            the bucket associated with ``environment`` is expected to be\n            updated.\n        :raises: ``FailTest`` if an error_key in any of the S3 buckets has been\n            updated unexpectedly.\n        ' #NEWLINE# bucket_names = set ( ) #NEWLINE# for e in Environments . iterconstants ( ) : #NEWLINE# #INDENT# bucket_names . add ( DOCUMENTATION_CONFIGURATIONS [ e ] . documentation_bucket ) #NEWLINE# #UNINDENT# empty_buckets = { bucket_name : { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } for bucket_name in bucket_names } #NEWLINE# empty_buckets [ 'clusterhq-staging-docs' ] = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# empty_error_keys = { bucket_name : b'' for bucket_name in bucket_names } #NEWLINE# aws = FakeAWS ( routing_rules = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } , s3_buckets = empty_buckets , error_key = empty_error_keys ) #NEWLINE# expected_error_path = 'en/{}/error_pages/404.html' . format ( doc_version ) #NEWLINE# expected_updated_bucket = DOCUMENTATION_CONFIGURATIONS [ environment ] . documentation_bucket #NEWLINE# expected_error_keys = aws . error_key . copy ( ) #NEWLINE# if should_update : #NEWLINE# #INDENT# expected_error_keys [ expected_updated_bucket ] = environment #NEWLINE# #UNINDENT# self . publish_docs ( aws , flocker_version = doc_version , doc_version = doc_version , environment = environment ) #NEWLINE# self . assertEqual ( expected_error_keys , aws . error_key )