@given(u'a file named "{filename}" and encoding="{encoding}" with')
def step_a_file_named_filename_and_encoding_with(context, filename, encoding):
 __encoding_is_valid = True
 assert (context.text is not None), 'ENSURE: multiline text is provided.'
 assert (not os.path.isabs(filename))
 assert __encoding_is_valid
 command_util.ensure_workdir_exists(context)
 filename2 = os.path.join(context.workdir, filename)
 pathutil.create_textfile_with_contents(filename2, context.text, encoding)

@ given ( u'a file named "{filename}" and encoding="{encoding}" with' ) def step_a_file_named_filename_and_encoding_with ( context , filename , encoding ) : __encoding_is_valid = True assert ( context . text is not None ) , 'ENSURE: multiline text is provided.' assert ( not os . path . isabs ( filename ) ) assert __encoding_is_valid command_util . ensure_workdir_exists ( context ) filename2 = os . path . join ( context . workdir , filename ) pathutil . create_textfile_with_contents ( filename2 , context . text , encoding )
creates a textual file with the content provided as docstring .