def test_require_file_from_string():
 from fabtools.require import file as require_file
 try:
  bar_contents = 'This is the contents of the bar file'
  require_file('bar', contents=bar_contents)
  assert is_file('bar')
  assert (run('cat bar') == bar_contents)
 finally:
  run('rm -f bar')

def test_require_file_from_string ( ) : from fabtools . require import file as require_file try : bar_contents = 'This is the contents of the bar file' require_file ( 'bar' , contents = bar_contents ) assert is_file ( 'bar' ) assert ( run ( 'cat bar' ) == bar_contents ) finally : run ( 'rm -f bar' )
require that a file exists .