#NEWLINE# def testReadandValidateSchemaFromFile( self ) : #NEWLINE# #INDENT# infile = os . path . join ( self . dirname , 'test_schema_file' ) #NEWLINE# f = open ( infile , 'wt' ) #NEWLINE# f . write ( test_util . GetCarsSchemaString ( ) ) #NEWLINE# f . close ( ) #NEWLINE# read_schema = load_lib . ReadSchemaFile ( infile ) #NEWLINE# load_lib . _ValidateExtendedSchema ( read_schema ) #NEWLINE# expected_schema = json . loads ( test_util . GetCarsSchemaString ( ) ) #NEWLINE# self . assertEquals ( expected_schema , f ) #NEWLINE# f = open ( infile , 'at' ) #NEWLINE# f . write ( 'bogus' ) #NEWLINE# f . close ( ) #NEWLINE# try : #NEWLINE# #INDENT# load_lib . ReadSchemaFile ( infile ) #NEWLINE# self . fail ( ) #NEWLINE# #UNINDENT# except ValueError : #NEWLINE# #INDENT# pass