<s> import unittest <EOL> from ... compatibility import StringIO <EOL> from . . helperfunctions import _xml_to_list <EOL> from ... worksheet import Worksheet <EOL> from ... format import Format <EOL> class TestAssembleWorksheet ( unittest . TestCase ) : <EOL> """<STR_LIT>""" <EOL> def test_assemble_xml_file ( self ) : <EOL> """<STR_LIT>""" <EOL> self . maxDiff = None <EOL> fh = StringIO ( ) <EOL> worksheet = Worksheet ( ) <EOL> worksheet . _set_filehandle ( fh ) <EOL> cell_format = Format ( { '<STR_LIT>' : <NUM_LIT:1> } ) <EOL> worksheet . write_blank ( <NUM_LIT:0> , <NUM_LIT:0> , None ) <EOL> worksheet . write_blank ( <NUM_LIT:1> , <NUM_LIT:2> , None , cell_format ) <EOL> worksheet . select ( ) <EOL> worksheet . _assemble_xml_file ( ) <EOL> exp = _xml_to_list ( """<STR_LIT>""" ) <EOL> got = _xml_to_list ( fh . getvalue ( ) ) <EOL> self . assertEqual ( got , exp ) <EOL> def test_assemble_xml_file_write ( self ) : <EOL> """<STR_LIT>""" <EOL> self . maxDiff = None <EOL> fh = StringIO ( ) <EOL> worksheet = Worksheet ( ) <EOL> worksheet . _set_filehandle ( fh ) <EOL> cell_format = Format ( { '<STR_LIT>' : <NUM_LIT:1> } ) <EOL> worksheet . write ( <NUM_LIT:0> , <NUM_LIT:0> , None ) <EOL> worksheet . write ( <NUM_LIT:1> , <NUM_LIT:2> , None , cell_format ) <EOL> worksheet . select ( ) <EOL> worksheet . _assemble_xml_file ( ) <EOL> exp = _xml_to_list ( """<STR_LIT>""" ) <EOL> got = _xml_to_list ( fh . getvalue ( ) ) <EOL> self . assertEqual ( got , exp ) <EOL> def test_assemble_xml_file_A1 ( self ) : <EOL> """<STR_LIT>""" <EOL> self . maxDiff = None <EOL> fh = StringIO ( ) <EOL> worksheet = Worksheet ( ) <EOL> worksheet . _set_filehandle ( fh ) <EOL> cell_format = Format ( { '<STR_LIT>' : <NUM_LIT:1> } ) <EOL> worksheet . write_blank ( '<STR_LIT>' , None ) <EOL> worksheet . write_blank ( '<STR_LIT>' , None , cell_format ) <EOL> worksheet . select ( ) <EOL> worksheet . _assemble_xml_file ( ) <EOL> exp = _xml_to_list ( """<STR_LIT>""" ) <EOL> got = _xml_to_list ( fh . getvalue ( ) ) <EOL> self . assertEqual ( got , exp ) </s>
