def __init__(self):

        CompareSectionTable.__init__(self)

        self.sheet_name = "sheet1"
        self.header_style = XlsStyle(backcolor="gray80", fontcolor="white", fontstyle="bold 1")
        self.first_style = XlsStyle(backcolor="dark_blue", fontcolor="white", fontstyle="")
        self.second_style = XlsStyle(backcolor="green", fontcolor="white", fontstyle="")
        self.missing_value_style = XlsStyle(backcolor="red", fontcolor="black", fontstyle="")
    def __init__(self):

        CompareSectionTable.__init__(self)

        self.sheet_name = "sheet1"
        self.header_style = XlsStyle(backcolor='gray80', fontcolor='white',
                                     fontstyle='bold 1')
        self.first_style = XlsStyle(backcolor='dark_blue', fontcolor='white',
                                    fontstyle='')
        self.second_style = XlsStyle(backcolor='green', fontcolor='white',
                                     fontstyle='')
        self.missing_value_style = XlsStyle(backcolor='red',
                                            fontcolor='black', fontstyle='', )
class TestCompareSectionTable(unittest.TestCase):
    def setUp(self):
        self.test_table = CompareSectionTable()
        self.doc = create_compare_test()
        odml.tools.xmlparser.XMLWriter(self.doc).write_file("comparetest.odml")

    def tearDown(self):
        os.remove("comparetest.odml")

    def test_loadfromfile(self):
        self.test_table.load_from_file("comparetest.odml")
        self.assertEqual(self.doc, self.test_table._odmldoc)

    def test_choose(self):
        self.test_table.choose_sections("Section3", "Section1", "One more Section")
        expected = [
            section.name
            for section in self.doc.itersections(
                filter_func=lambda x: x.name in ["Section1", "Section3", "One more Section"]
            )
        ]
        result = [section.name for section in self.doc.itersections(filter_func=self.test_table._sel_fun)]
        self.assertItemsEqual(expected, result)

    def test_choose_start(self):
        self.test_table.choose_sections_startwith("Section")
        expected = [
            section.name for section in self.doc.itersections(filter_func=lambda x: x.name.startswith("Section"))
        ]
        result = [section.name for section in self.doc.itersections(filter_func=self.test_table._sel_fun)]
        self.assertItemsEqual(expected, result)
    def __init__(self):

        CompareSectionTable.__init__(self)
 def setUp(self):
     self.test_table = CompareSectionTable()
     self.doc = create_compare_test()
     odml.tools.xmlparser.XMLWriter(self.doc).write_file("comparetest.odml")