#NEWLINE# def test_create_file( self ) : #NEWLINE# #INDENT# 'Test the creation of a simple XlsxWriter file with conditional formatting.' #NEWLINE# workbook = Workbook ( self . got_filename ) #NEWLINE# worksheet = workbook . add_worksheet ( ) #NEWLINE# format1 = workbook . add_format ( { #NEWLINE# #INDENT# 'num_format' : 2 , #NEWLINE# 'dxf_index' : 1 , #NEWLINE# #UNINDENT# } ) #NEWLINE# format2 = workbook . add_format ( { #NEWLINE# #INDENT# 'num_format' : '0.000' , #NEWLINE# 'dxf_index' : 0 , #NEWLINE# #UNINDENT# } ) #NEWLINE# worksheet . write ( 'A1' , 10 ) #NEWLINE# worksheet . write ( 'A2' , 20 ) #NEWLINE# worksheet . write ( 'A3' , 30 ) #NEWLINE# worksheet . write ( 'A4' , 40 ) #NEWLINE# worksheet . conditional_format ( 'A1' , { #NEWLINE# #INDENT# 'type' : 'cell' , #NEWLINE# 'format' : workbook , #NEWLINE# 'criteria' : '>' , #NEWLINE# 'value' : 2 , #NEWLINE# #UNINDENT# } ) #NEWLINE# worksheet . conditional_format ( 'A2' , { #NEWLINE# #INDENT# 'type' : 'cell' , #NEWLINE# 'format' : format2 , #NEWLINE# 'criteria' : '<' , #NEWLINE# 'value' : 8 , #NEWLINE# #UNINDENT# } ) #NEWLINE# workbook . close ( ) #NEWLINE# self . assertExcelEqual ( )