@then(u'the command output should contain "{text}" {count:d} times')
def step_command_output_should_contain_text_multiple_times(context, text, count):
 assert (count >= 0)
 expected_text = text
 if (('{__WORKDIR__}' in expected_text) or ('{__CWD__}' in expected_text)):
  expected_text = textutil.template_substitute(text, __WORKDIR__=posixpath_normpath(context.workdir), __CWD__=posixpath_normpath(os.getcwd()))
 actual_output = context.command_result.output
 with on_assert_failed_print_details(actual_output, expected_text):
  textutil.assert_normtext_should_contain_multiple_times(actual_output, expected_text, count)

@ then ( u'the command output should contain "{text}" {count:d} times' ) def step_command_output_should_contain_text_multiple_times ( context , text , count ) : assert ( count >= 0 ) expected_text = text if ( ( '{__WORKDIR__}' in expected_text ) or ( '{__CWD__}' in expected_text ) ) : expected_text = textutil . template_substitute ( text , __WORKDIR__ = posixpath_normpath ( context . workdir ) , __CWD__ = posixpath_normpath ( os . getcwd ( ) ) ) actual_output = context . command_result . output with on_assert_failed_print_details ( actual_output , expected_text ) : textutil . assert_normtext_should_contain_multiple_times ( actual_output , expected_text , count )
example: then the command output should contain "text" 3 times .