#NEWLINE# def test_replay_validation( self ) : #NEWLINE# #INDENT# from jsonschema import validate #NEWLINE# file_match = re . compile ( '.*\\.hsreplay' ) #NEWLINE# files = [ ] #NEWLINE# def get_files_from( folder_name ) : #NEWLINE# #INDENT# for file in listdir ( folder_name ) : #NEWLINE# #INDENT# if file_match . match ( file ) : #NEWLINE# #INDENT# files . append ( ( ( folder_name + '/' ) + file ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if isdir ( ( ( folder_name + '/' ) + file ) ) : #NEWLINE# #INDENT# get_files_from ( ( ( folder_name + '/' ) + file ) ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# with open ( 'replay.schema.json' , 'r' ) as schema_file : #NEWLINE# #INDENT# schema = json . load ( schema_file ) #NEWLINE# get_files_from ( 'tests/replays' ) #NEWLINE# for rfile in files : #NEWLINE# #INDENT# with open ( replay_json , 'r' ) as replay_file : #NEWLINE# #INDENT# replay_json = json . load ( replay_file ) #NEWLINE# validate ( replay_json , schema )