Passed
Push — main ( 97b175...ba1019 )
by Sat CFDI
05:01
created

test_custom_template   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 17
dl 0
loc 27
rs 10
c 0
b 0
f 0
wmc 2
1
import os
2
3
from satcfdi.cfdi import CFDI
4
from tests.utils import verify_result
5
6
module = 'satcfdi'
7
current_dir = os.path.dirname(__file__)
8
9
10
def verify_invoice(invoice, path):
11
    verify = verify_result(
12
        data=invoice.html_str(
13
            templates_path=os.path.join(current_dir, 'templates')
14
        ),
15
        filename=f"{path}.html"
16
    )
17
    assert verify
18
19
20
def test_custom_template():
21
    xml_file = "cfdv40-ejemplo.xml"
22
    cfdi = CFDI.from_file(
23
        os.path.join(current_dir, 'cfdi_ejemplos/comprobante40', xml_file)
24
    )
25
26
    verify_invoice(cfdi, xml_file)
27