def test_cfdi32_detail_01_from_bytes_ok(self): path_xml = "./tests/Resources/cfdi32_01.xml" xml_bytes = None with io.open(path_xml, 'r', encoding='utf8') as f: xml_bytes = f.read() xml_bytes = bytes(bytearray(xml_bytes, encoding='utf-8')) transformer = ct.TCfdi32Detail() result_columns = transformer.to_columns_from_bytes(xml_bytes) self.assertFalse(result_columns is None) self.assertTrue(len(result_columns) == 2) self.assertTrue(len(result_columns[0]) == 33)
def test_cfdi32_detail_get_column_names_ok(self): transformer = ct.TCfdi32Detail() result_columns = transformer.get_column_names() self.assertFalse(result_columns is None) self.assertTrue(len(result_columns) == 33)
def test_cfdi32_detail_01_from_file_ok(self): path_xml = "./tests/Resources/cfdi32_01.xml" transformer = ct.TCfdi32Detail() result_columns = transformer.to_columns_from_file(path_xml) self.assertTrue(len(result_columns) == 2) self.assertTrue(len(result_columns[0]) == 33)