#NEWLINE# def load( file , _ , assign ) : #NEWLINE# #INDENT# 'Loads Scheme tests from a specified filepath.\n\n    PARAMETERS:\n    file -- str; a filepath to a Scheme file.\n\n    RETURNS:\n    Test\n    ' #NEWLINE# if ( ( not os . path . isfile ( file ) ) or ( not file . endswith ( '.scm' ) ) ) : #NEWLINE# #INDENT# raise ex . LoadingException ( 'Cannot run Scheme tests from {}' . format ( assign ) ) #NEWLINE# #UNINDENT# with open ( file , 'r' ) as f : #NEWLINE# #INDENT# file_contents = f . read ( ) #NEWLINE# #UNINDENT# try : #NEWLINE# #INDENT# return { #NEWLINE# #INDENT# file : models . SchemeTest ( file , file_contents , assign . cmd_args . timeout , name = file , points = 1 ) , #NEWLINE# #UNINDENT# } #NEWLINE# #UNINDENT# except ex . SerializeException : #NEWLINE# #INDENT# raise ex . LoadingException ( 'Unable to load Scheme test from {}' . format ( file ) )