Ejemplo n.º 1
0
 def test_print_formula_cell_text(self):
     '''
     Test correct formatting of a formula cell with string value
     '''
     xml = '''<c r="E7"><f ca="1">E6+$C$6</f><v>"This is a string"</v></c>'''
     cell = self.setup(xml)
     string = print_cells(cell)
     tools.assert_equal(string, "fo    E7 = E6+$C$6    This is a string")
Ejemplo n.º 2
0
 def test_print_formula_cell_value(self):
     '''
     Test correct formatting of a formula cell with numerical value
     '''
     xml = '''<c r="E7"><f ca="1">E6+$C$6</f><v>4.45</v></c>'''
     cell = self.setup(xml)
     string = print_cells(cell)
     tools.assert_equal(string, "fo    E7 = E6+$C$6    4.45")
Ejemplo n.º 3
0
    def test(self):
        """
        Opens the test workbook and checks the print out matches the content
        """
        filename = "tests/test1.xlsx"
        sheets = list(get_worksheets(filename))
        string_dict = get_shared_strings("xl/sharedStrings.xml")

        sheet = sheets[0]
        output, shared_formulas = parse_worksheet(sheet, string_dict)
        post_process(output, shared_formulas, string_dict)
        tools.assert_equal(print_cells(output), "st    A1    Hello World")
Ejemplo n.º 4
0
 def test_print_value_cell(self):
     xml = '''<c r="A3"><v>9.48</v></c>'''
     cell = self.setup(xml)
     string = print_cells(cell)
     tools.assert_equal(string, "va    A3    9.48")