示例#1
0
    def test_fills(self):

        self.worksheet.cell('A1').style.fill.fill_type = 'solid'
        self.worksheet.cell('A1').style.fill.start_color.index = Color.DARKYELLOW
        w = StyleWriter(self.workbook)
        w._write_fills()
        eq_(get_xml(w._root), '<?xml version=\'1.0\' encoding=\'UTF-8\'?><styleSheet xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main"><fills count="3"><fill><patternFill patternType="none" /></fill><fill><patternFill patternType="gray125" /></fill><fill><patternFill patternType="solid"><fgColor rgb="FF808000" /></patternFill></fill></fills></styleSheet>')
示例#2
0
    def test_fills(self):

        self.worksheet.cell('A1').style.fill.fill_type = 'solid'
        self.worksheet.cell('A1').style.fill.start_color.index = Color.DARKYELLOW
        w = StyleWriter(self.workbook)
        w._write_fills()
        eq_(get_xml(w._root), '<?xml version=\'1.0\' encoding=\'UTF-8\'?><styleSheet xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main"><fills count="3"><fill><patternFill patternType="none" /></fill><fill><patternFill patternType="gray125" /></fill><fill><patternFill patternType="solid"><fgColor rgb="FF808000" /></patternFill></fill></fills></styleSheet>')
示例#3
0
 def test_fills(self):
     st = Style(fill=PatternFill(fill_type='solid',
                                 start_color=Color(colors.DARKYELLOW)))
     self.worksheet.cell('A1').style = st
     w = StyleWriter(self.workbook)
     w._write_fills()
     xml = get_xml(w._root)
     diff = compare_xml(
         xml, """
     <styleSheet xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main">
       <fills count="3">
         <fill>
           <patternFill patternType="none" />
         </fill>
         <fill>
           <patternFill patternType="gray125" />
         </fill>
         <fill>
           <patternFill patternType="solid">
             <fgColor rgb="0000FF00" />
           </patternFill>
         </fill>
       </fills>
     </styleSheet>
     """)
     assert diff is None, diff
示例#4
0
 def test_fills(self):
     st = Style(fill=PatternFill(fill_type='solid',
                          start_color=Color(colors.DARKYELLOW)))
     self.worksheet.cell('A1').style = st
     w = StyleWriter(self.workbook)
     w._write_fills()
     xml = get_xml(w._root)
     diff = compare_xml(xml, """
     <styleSheet xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main">
       <fills count="3">
         <fill>
           <patternFill patternType="none" />
         </fill>
         <fill>
           <patternFill patternType="gray125" />
         </fill>
         <fill>
           <patternFill patternType="solid">
             <fgColor rgb="0000FF00" />
           </patternFill>
         </fill>
       </fills>
     </styleSheet>
     """)
     assert diff is None, diff
示例#5
0
 def test_fills(self):
     self.worksheet.cell('A1').style.fill.fill_type = 'solid'
     self.worksheet.cell('A1').style.fill.start_color.index = Color.DARKYELLOW
     w = StyleWriter(self.workbook)
     w._write_fills()
     expected = """<styleSheet xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main"><fills count="3"><fill><patternFill patternType="none" /></fill><fill><patternFill patternType="gray125" /></fill><fill><patternFill patternType="solid"><fgColor rgb="FF808000" /></patternFill></fill></fills></styleSheet>"""
     xml = get_xml(w._root)
     diff = compare_xml(xml, expected)
     assert diff is None, diff