def make_undefined_step_snippet(step, language=None):
 if isinstance(step, string_types):
  step_text = step
  steps = parser.parse_steps(step_text, language=language)
  step = steps[0]
  assert step, ('ParseError: %s' % step_text)
 prefix = u'u'
 single_quote = "'"
 if (single_quote in step.name):
  step.name = step.name.replace(single_quote, "\\'")
 schema = u"@%s(%s'%s')\ndef step_impl(context):\n"
 schema += u"    raise NotImplementedError(%s'STEP: %s %s')\n\n"
 snippet = (schema % (step.step_type, prefix, step.name, prefix, step.step_type.title(), step.name))
 return snippet

def make_undefined_step_snippet ( step , language = None ) : if isinstance ( step , string_types ) : step_text = step steps = parser . parse_steps ( step_text , language = language ) step = steps [ 0 ] assert step , ( 'ParseError: %s' % step_text ) prefix = u'u' single_quote = "'" if ( single_quote in step . name ) : step . name = step . name . replace ( single_quote , "\\'" ) schema = u"@%s(%s'%s')\ndef step_impl(context):\n" schema += u"    raise NotImplementedError(%s'STEP: %s %s')\n\n" snippet = ( schema % ( step . step_type , prefix , step . name , prefix , step . step_type . title ( ) , step . name ) ) return snippet
helper function to create an undefined-step snippet for a step .