def create_fake_repository(test_case, files):
 source_repo = FilePath(test_case.mktemp())
 source_repo.createDirectory
 for key in files:
  new_file = source_repo.preauthChild(key)
  if (not new_file.parent().exists()):
   new_file.parent().makedirs()
  new_file.setContent(files[key])
 return ('file://' + source_repo.path)

def create_fake_repository ( test_case , files ) : source_repo = FilePath ( test_case . mktemp ( ) ) source_repo . createDirectory for key in files : new_file = source_repo . preauthChild ( key ) if ( not new_file . parent ( ) . exists ( ) ) : new_file . parent ( ) . makedirs ( ) new_file . setContent ( files [ key ] ) return ( 'file://' + source_repo . path )
create files in a directory to mimic a repository of packages .