def __test_html():
 with open('test.rpt', 'r') as input_file:
  data_text = input_file.read()
 data = yaml.safe_load(data_text)
 string_file = StringIO.StringIO()
 _generate_html(data, string_file)
 string_file.seek(0)
 result = string_file.read()
 with open('test.html', 'w') as output:
  output.write(result)

def __test_html ( ) : with open ( 'test.rpt' , 'r' ) as input_file : data_text = input_file . read ( ) data = yaml . safe_load ( data_text ) string_file = StringIO . StringIO ( ) _generate_html ( data , string_file ) string_file . seek ( 0 ) result = string_file . read ( ) with open ( 'test.html' , 'w' ) as output : output . write ( result )
html generation test only used when called from the command line: python .