<commit_before>import os
import unittest
from facturapdf import InvoiceGenerator
from tests.helper import get_output_folder, get_initios_logo_path
from os.path import isdir, isfile, splitext
from facturapdf.dtos import Customer, Metadata


class TestCase(unittest.TestCase):
    def assertIsFolder(self, folder):
        self.assertTrue(isdir(folder))

    def assertIsFile(self, file):
        self.assertTrue(isfile(file))

    def assertExtension(self, file, ext):
        self.assertTrue(splitext(file)[1] == '.pdf')


class CreateInvoiceTest(TestCase):
    def setUp(self):
        self.file = os.path.join(get_output_folder(), "output.pdf")
        self.initios_logo = get_initios_logo_path()
        self.invoice_generator = InvoiceGenerator()

    def test_can_create_a_invoice(self):
        customer = Customer(
            code='CUS1', name='<NAME>', vat='123456789X',
            address='Long address from our customer', city='Vigo',
            postal_code='309182', province='Pontevedra', country='España',
            contact_name='<NAME>', contact_phone='9876542817', contact_email='<EMAIL>'<commit_msg>Fixed typo<commit_after>import os
import unittest
from facturapdf import InvoiceGenerator
from tests.helper import get_output_folder, get_initios_logo_path
from os.path import isdir, isfile, splitext
from facturapdf.dtos import Customer, Metadata


class TestCase(unittest.TestCase):
    def assertIsFolder(self, folder):
        self.assertTrue(isdir(folder))

    def assertIsFile(self, file):
        self.assertTrue(isfile(file))

    def assertExtension(self, file, ext):
        self.assertTrue(splitext(file)[1] == '.pdf')


class CreateInvoiceTest(TestCase):
    def setUp(self):
        self.file = os.path.join(get_output_folder(), "output.pdf")
        self.initios_logo = get_initios_logo_path()
        self.invoice_generator = InvoiceGenerator()

    def test_can_create_an_invoice(self):
        customer = Customer(
            code='CUS1', name='<NAME>', vat='123456789X',
            address='Long address from our customer', city='Vigo',
            postal_code='309182', province='Pontevedra', country='España',
            contact_name='<NAME>', contact_phone='9876542817', contact_email='<EMAIL>'
{'fraction_non_alphanumeric': 0.11528150134048257, 'fraction_numerical': 0.024128686327077747, 'mean_word_length': 4.088636363636364, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2235135', 'n_tokens_mistral': 717, 'n_tokens_neox': 680, 'n_words': 140}