コード例 #1
0
ファイル: test_style.py プロジェクト: Khan/openpyxl
    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
ファイル: test_style.py プロジェクト: huier18/PythonScripts
 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
ファイル: test_style.py プロジェクト: ericgazoni/openpyxl
 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
ファイル: test_style.py プロジェクト: albin-zhu/xls2proto
    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
ファイル: test_style.py プロジェクト: LKI/PythonScripts
 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