def test_render_to_file(Chart, datas):
 file_name = ('/tmp/test_graph-%s.svg' % uuid.uuid4())
 if os.path.exists(file_name):
  os.remove(file_name)
 chart = Chart()
 chart = make_data(chart, datas)
 chart.render_to_file(file_name)
 with io.open(file_name, encoding='utf-8') as f:
  assert ('pygal' in f.read())
 os.remove(file_name)

def test_render_to_file ( Chart , datas ) : file_name = ( '/tmp/test_graph-%s.svg' % uuid . uuid4 ( ) ) if os . path . exists ( file_name ) : os . remove ( file_name ) chart = Chart ( ) chart = make_data ( chart , datas ) chart . render_to_file ( file_name ) with io . open ( file_name , encoding = 'utf-8' ) as f : assert ( 'pygal' in f . read ( ) ) os . remove ( file_name )
test in file rendering .