Пример #1
0
    def test_borders(self):

        self.worksheet.cell('A1').style.borders.top.border_style = Border.BORDER_THIN
        self.worksheet.cell('A1').style.borders.top.color.index = Color.DARKYELLOW
        w = StyleWriter(self.workbook)
        w._write_borders()
        eq_(get_xml(w._root), '<?xml version=\'1.0\' encoding=\'UTF-8\'?><styleSheet xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main"><borders count="2"><border><left /><right /><top /><bottom /><diagonal /></border><border><left /><right /><top style="thin"><color rgb="FF808000" /></top><bottom /><diagonal /></border></borders></styleSheet>')
Пример #2
0
 def test_borders(self):
     st = Style(border=Border(top=Side(border_style=borders.BORDER_THIN,
                                       color=Color(colors.DARKYELLOW))))
     self.worksheet.cell('A1').style = st
     w = StyleWriter(self.workbook)
     w._write_borders()
     xml = get_xml(w._root)
     diff = compare_xml(
         xml, """
     <styleSheet xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main">
       <borders count="2">
         <border>
           <left />
           <right />
           <top />
           <bottom />
           <diagonal />
         </border>
         <border>
           <left />
           <right />
           <top style="thin">
             <color rgb="0000FF00" />
           </top>
           <bottom />
           <diagonal />
         </border>
       </borders>
     </styleSheet>
     """)
     assert diff is None, diff
Пример #3
0
 def test_borders(self):
     self.worksheet.cell('A1').style.borders.top.border_style = Border.BORDER_THIN
     self.worksheet.cell('A1').style.borders.top.color.index = Color.DARKYELLOW
     w = StyleWriter(self.workbook)
     w._write_borders()
     xml = get_xml(w._root)
     diff = compare_xml(xml, """
     <styleSheet xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main">
       <borders count="2">
         <border>
           <left />
           <right />
           <top />
           <bottom />
           <diagonal />
         </border>
         <border>
           <left />
           <right />
           <top style="thin">
             <color rgb="FF808000" />
           </top>
           <bottom />
           <diagonal />
         </border>
       </borders>
     </styleSheet>
     """)
     assert diff is None, diff
Пример #4
0
    def test_borders(self):

        self.worksheet.cell('A1').style.borders.top.border_style = Border.BORDER_THIN
        self.worksheet.cell('A1').style.borders.top.color.index = Color.DARKYELLOW
        w = StyleWriter(self.workbook)
        w._write_borders()
        eq_(get_xml(w._root), '<?xml version=\'1.0\' encoding=\'UTF-8\'?><styleSheet xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main"><borders count="2"><border><left /><right /><top /><bottom /><diagonal /></border><border><left style="none"><color rgb="FF000000" /></left><right style="none"><color rgb="FF000000" /></right><top style="thin"><color rgb="FF808000" /></top><bottom style="none"><color rgb="FF000000" /></bottom><diagonal style="none"><color rgb="FF000000" /></diagonal></border></borders></styleSheet>')
Пример #5
0
 def test_borders(self):
     st = Style(border=Border(top=Side(border_style=borders.BORDER_THIN,
                                           color=Color(colors.DARKYELLOW))))
     self.worksheet.cell('A1').style = st
     w = StyleWriter(self.workbook)
     w._write_borders()
     xml = get_xml(w._root)
     diff = compare_xml(xml, """
     <styleSheet xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main">
       <borders count="2">
         <border>
           <left />
           <right />
           <top />
           <bottom />
           <diagonal />
         </border>
         <border>
           <left />
           <right />
           <top style="thin">
             <color rgb="0000FF00" />
           </top>
           <bottom />
           <diagonal />
         </border>
       </borders>
     </styleSheet>
     """)
     assert diff is None, diff
Пример #6
0
 def test_borders(self):
     self.worksheet.cell(
         'A1').style.borders.top.border_style = Border.BORDER_THIN
     self.worksheet.cell(
         'A1').style.borders.top.color.index = Color.DARKYELLOW
     w = StyleWriter(self.workbook)
     w._write_borders()
     xml = get_xml(w._root)
     diff = compare_xml(
         xml, """
     <styleSheet xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main">
       <borders count="2">
         <border>
           <left />
           <right />
           <top />
           <bottom />
           <diagonal />
         </border>
         <border>
           <left />
           <right />
           <top style="thin">
             <color rgb="FF808000" />
           </top>
           <bottom />
           <diagonal />
         </border>
       </borders>
     </styleSheet>
     """)
     assert diff is None, diff