def test_scrape_transfer_third_party_email(load_email): """it should be able to scrape a transfer third party email""" html = load_email(EMAIL_PATH) actual = transfer_third_party_email.scrape(html) expected = ExpenseRecord( type='EXPENSE', source='TRANSFER_THIRD_PARTY_EMAIL', note='Transferencias a Cuentas de Terceros | ' 'CUENTA ENLACE PERSONAL - *******1111 | Ana - *******7777 | A - 112', operation_date='22/Feb/2021 19:06:53 horas', amount='1000.00', extra_amounts=[ ExtraAmount( name='tax', amount='0.00', tax='0.00', ), ExtraAmount( name='fee', amount='0.00', tax='0.00', ), ], receiver=Receiver( bank='Banorte', name='Ana', ), ) assert actual == expected
def test_scrape(load_email): """it should be able to scrape a credit card payment other banks email""" html = load_email(EMAIL_PATH) actual = cc_payment_other_banks_email.scrape(html) expected = ExpenseRecord( type='EXPENSE', source='CREDIT_CARD_PAYMENT_OTHER_BANKS_EMAIL', note= 'Pago de Tarjeta de Crédito Otros Bancos | [email protected] | - ************1111', operation_date='27/Mar/2020 17:10:27 horas', extra_amounts=[ ExtraAmount( name='fee', amount='0.00', tax='0.00', ), ], amount='2754.00', receiver=Receiver( name='OTRO USUARIO', bank='STP', ), ) assert actual == expected
def test_scrape_fast_transfer_banorte_email(load_email): """it should be able to scrape a transfer national banks SPEI email""" html = load_email(EMAIL_PATH) actual = transfer_national_banks_spei_email.scrape(html) expected = ExpenseRecord( type='EXPENSE', source='TRANSFER_NATIONAL_BANKS_SPEI_EMAIL', note='Transferencia a Otros Bancos Nacionales - SPEI | ' 'CUENTA ENLACE PERSONAL - *******1111 | Ana G - *******1111 | MBP', operation_date='12/Dic/2020 15:11:23 horas', amount='12000.00', extra_amounts=[ ExtraAmount( name='fee', amount='3.00', tax='0.48', ), ], receiver=Receiver( bank='STP', name='Ana', ), ) assert actual == expected
def test_scrape(load_email): """it should be able to scrape a credit card payment third parties email""" html = load_email(EMAIL_PATH) actual = cc_payment_third_parties.scrape(html) expected = ExpenseRecord( type='EXPENSE', source='CREDIT_CARD_PAYMENT_THIRD_PARTIES_EMAIL', note= 'Pago de Tarjeta de Crédito Terceros | [email protected] | ************1234 | - ************2222', operation_date='20/Ago/2020 19:49:10 horas', extra_amounts=[ ExtraAmount( name='fee', amount='0.00', tax='0.00', ), ], amount='1.00', receiver=Receiver( name='OTRO USUARIO', bank='Nu', ), ) assert actual == expected
def test_scrape(load_email): """it should be able to scrape a deposit email""" html = load_email(EMAIL_PATH) actual = deposit_email.scrape(html) expected = ExpenseRecord( type='EXPENSE', source='DEPOSIT_EMAIL', note='Instrucción de Depósito | Pago del cine', operation_date='31/Oct/2019 13:41:03 horas', amount='792.00', receiver=Receiver( name='USUARIO BBVA BANCOMER', bank='BBVA BANCOMER', ), ) assert actual == expected
def test_scrape_fast_transfer_other_banks_email(load_email): """it should be able to scrape an email for a transfer to another bank""" html = load_email(FAST_TRANSFER_OTHER_BANKS_EMAIL_PATH) actual = fast_transfer_email.scrape(html) expected = ExpenseRecord( type='EXPENSE', source='FAST_TRANSFER_EMAIL', note='Transferencias Rápidas | Open source | [email protected]', operation_date='03/Ago/2019 11:13:14 horas', amount='806.00', extra_amounts=[ExtraAmount(name='fee', amount='3.00', tax='0.48')], receiver=Receiver( bank='BBVA BANCOMER', name='GitHub', ), ) assert actual == expected
def test_scrape_fast_transfer_banorte_email(load_email): """it should be able to scrape an email for a transfer to a banorte account""" html = load_email(FAST_TRANSFER_BANORTE_EMAIL_PATH) actual = fast_transfer_email.scrape(html) expected = ExpenseRecord( type='EXPENSE', source='FAST_TRANSFER_EMAIL', note='Transferencias Rápidas | Cosas | [email protected]', operation_date='21/Oct/2019 11:23:02 horas', amount='600.00', extra_amounts=[ExtraAmount(name='fee', amount='0.00', tax='0.00')], receiver=Receiver( bank='Banorte', name='No capturado', ), ) assert actual == expected