def test_cfdi33_01_from_file_ok(self): path_xml = "./tests/Resources/cfdi33_01.xml" transformer = ct.TCfdi33() result_columns = transformer.to_columns_from_file(path_xml) self.assertFalse(result_columns is None) self.assertTrue(len(result_columns) == 1) self.assertTrue(len(result_columns[0]) == 37)
def test_cfdi33_01_from_bytes_ok(self): path_xml = "./tests/Resources/cfdi33_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.TCfdi33() result_columns = transformer.to_columns_from_bytes(xml_bytes) self.assertFalse(result_columns is None) self.assertTrue(len(result_columns) == 1) self.assertTrue(len(result_columns[0]) == 37)
def test_cfdi33_get_column_names_ok(self): transformer = ct.TCfdi33() result_columns = transformer.get_column_names() self.assertFalse(result_columns is None) self.assertTrue(len(result_columns) == 37)