#NEWLINE# @ mock . patch ( 'swift.container.auditor.ContainerBroker' , FakeContainerBroker ) #NEWLINE# def test_run_once( self ) : #NEWLINE# #INDENT# conf = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# test_auditor = auditor . ContainerAuditor ( conf , logger = self . logger ) #NEWLINE# def fake_audit_location_generator( * args , **kwargs ) : #NEWLINE# #INDENT# files = os . listdir ( self . testdir ) #NEWLINE# return [ ( os . path . join ( self . testdir , f ) , '' , '' ) for f in files ] #NEWLINE# #UNINDENT# with mock . patch ( 'swift.container.auditor.audit_location_generator' , fake_audit_location_generator ) : #NEWLINE# #INDENT# test_auditor . run_once ( ) #NEWLINE# #UNINDENT# self . assertEqual ( test_auditor . container_failures , 2 ) #NEWLINE# self . assertEqual ( test_auditor . container_passes , 3 )