Example #1
0
 def test_filer_read_excel(self):
     """
     Test if it can read an xlsx document
     :return: list
     """
     f = Filer()
     result = f.read_excel("test.xlsx")
     expected = [['A001', 'M', 26, 200, 'Normal', 20, '08-10-1991'],
                 ['A002', 'F', 26, 300, 'Normal', 30, '09-10-1991']]
     self.assertEqual(result, expected, "file does not match")
Example #2
0
 def test_filer_save_excel_and_read_saved(self):
     """
     Test if it can save to excel
     :return:
     """
     f = Filer()
     li1 = [['A001', 'M', '26', '200', 'Normal', '20', '08-10-1991'],
            ['A002', 'F', '26', '300', 'Normal', '30', '09-10-1991']]
     f.save_excel('doc_test22.xlsx', li1)
     result = f.read_excel("doc_test22.xlsx")
     expected = [['A002', 'F', 26, 300, 'Normal', 30, '09-10-1991']]
     self.assertEqual(result, expected, "saved file couldn't be read")