'Test for number format and font styles.'

def test_assemble_xml_file(self):

    self.maxDiff = None
    fh = StringIO()
    style = Styles()
    style._set_filehandle(fh)
    workbook = Workbook()
    workbook.add_format({'num_format': 2})
    workbook.add_format({'num_format': 2, 'bold': 1})
    workbook.add_format({'num_format': '0.0'})
    workbook._set_default_xf_indices()
    workbook._prepare_format_properties()
    style._set_style_properties([workbook.xf_formats, workbook.palette, workbook.font_count, workbook.num_format_count, workbook.border_count, workbook.fill_count, workbook.custom_colors, workbook.dxf_formats])
    style._assemble_xml_file()
    workbook.fileclosed = 1
    exp = _xml_to_list('\n                                                                <?xml    version="1.0"    encoding="UTF-8"    standalone="yes"?>\n                                                                <styleSheet    xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main">\n                                                                        <numFmts    count="1">\n                                                                                <numFmt    numFmtId="164"    formatCode="0.0"/>\n                                                                        </numFmts>\n                                                                        <fonts    count="2">\n                                                                                <font>\n                                                                                        <sz    val="11"/>\n                                                                                        <color    theme="1"/>\n                                                                                        <name    val="Calibri"/>\n                                                                                        <family    val="2"/>\n                                                                                        <scheme    val="minor"/>\n                                                                                </font>\n                                                                                <font>\n                                                                                        <b/>\n                                                                                        <sz    val="11"/>\n                                                                                        <color    theme="1"/>\n                                                                                        <name    val="Calibri"/>\n                                                                                        <family    val="2"/>\n                                                                                        <scheme    val="minor"/>\n                                                                                </font>\n                                                                        </fonts>\n                                                                        <fills    count="2">\n                                                                                <fill>\n                                                                                        <patternFill    patternType="none"/>\n                                                                                </fill>\n                                                                                <fill>\n                                                                                        <patternFill    patternType="gray125"/>\n                                                                                </fill>\n                                                                        </fills>\n                                                                        <borders    count="1">\n                                                                                <border>\n                                                                                        <left/>\n                                                                                        <right/>\n                                                                                        <top/>\n                                                                                        <bottom/>\n                                                                                        <diagonal/>\n                                                                                </border>\n                                                                        </borders>\n                                                                        <cellStyleXfs    count="1">\n                                                                                <xf    numFmtId="0"    fontId="0"    fillId="0"    borderId="0"/>\n                                                                        </cellStyleXfs>\n                                                                        <cellXfs    count="4">\n                                                                                <xf    numFmtId="0"    fontId="0"    fillId="0"    borderId="0"    xfId="0"/>\n                                                                                <xf    numFmtId="2"    fontId="0"    fillId="0"    borderId="0"    xfId="0"    applyNumberFormat="1"/>\n                                                                                <xf    numFmtId="2"    fontId="1"    fillId="0"    borderId="0"    xfId="0"    applyNumberFormat="1"    applyFont="1"/>\n                                                                                <xf    numFmtId="164"    fontId="0"    fillId="0"    borderId="0"    xfId="0"    applyNumberFormat="1"/>\n                                                                        </cellXfs>\n                                                                        <cellStyles    count="1">\n                                                                                <cellStyle    name="Normal"    xfId="0"    builtinId="0"/>\n                                                                        </cellStyles>\n                                                                        <dxfs    count="0"/>\n                                                                        <tableStyles    count="0"    defaultTableStyle="TableStyleMedium9"    defaultPivotStyle="PivotStyleLight16"/>\n                                                                </styleSheet>\n                                                                ')
    got = _xml_to_list(fh.getvalue())
    self.assertEqual(got, exp)
