#NEWLINE# @ patch ( 'sys.stdout' ) #NEWLINE# @ patch ( 'behave.reporter.summary.format_summary' ) #NEWLINE# def test_step_status_is_collected_and_reported( self , format_summary , stdout ) : #NEWLINE# #INDENT# feature = Mock ( ) #NEWLINE# scenario = Mock ( ) #NEWLINE# steps = [ Mock ( ) , Mock ( ) , Mock ( ) , Mock ( ) , Mock ( ) ] #NEWLINE# steps [ 0 ] . status = 'failed' #NEWLINE# steps [ 0 ] . __iter__ = Mock ( return_value = iter ( [ ] ) ) #NEWLINE# steps [ 1 ] . status = 'undefined' #NEWLINE# steps [ 1 ] . __iter__ = Mock ( return_value = iter ( [ ] ) ) #NEWLINE# steps [ 2 ] . status = 'passed' #NEWLINE# steps [ 2 ] . __iter__ = Mock ( return_value = iter ( [ ] ) ) #NEWLINE# steps [ 3 ] . status = 'passed' #NEWLINE# steps [ 3 ] . __iter__ = Mock ( return_value = iter ( [ ] ) ) #NEWLINE# steps [ 4 ] . status = None #NEWLINE# steps [ 4 ] . __iter__ = Mock ( return_value = iter ( [ ] ) ) #NEWLINE# feature . status = 'failed' #NEWLINE# feature . duration = 12.3 #NEWLINE# feature . __iter__ = Mock ( return_value = iter ( [ scenario ] ) ) #NEWLINE# scenario . status = 'failed' #NEWLINE# scenario . __iter__ = Mock ( return_value = iter ( steps ) ) #NEWLINE# config = Mock ( ) #NEWLINE# reporter = SummaryReporter ( config ) #NEWLINE# reporter . feature ( feature ) #NEWLINE# reporter . end ( ) #NEWLINE# expected = { #NEWLINE# #INDENT# 'passed' : 2 , #NEWLINE# 'failed' : 1 , #NEWLINE# 'skipped' : 1 , #NEWLINE# 'untested' : 0 , #NEWLINE# 'undefined' : 1 , #NEWLINE# #UNINDENT# } #NEWLINE# eq_ ( format_summary . call_args_list [ 2 ] [ 0 ] , ( 'step' , expected ) )