Skip to content

Commit

Permalink
refactor(tests): move bank PDF fixtures to same dir as test files
Browse files Browse the repository at this point in the history
  • Loading branch information
benjamin-awd committed Oct 29, 2023
1 parent d32784f commit 10ac6a7
Show file tree
Hide file tree
Showing 19 changed files with 19 additions and 516 deletions.
2 changes: 1 addition & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1 +1 @@
tests/integration/fixtures/**/input.pdf filter=git-crypt diff=git-crypt
tests/integration/banks/**/input.pdf filter=git-crypt diff=git-crypt
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ _ignore*

# allowed pdf files/fixtures
!tests/integration/fixtures/*/**
!tests/integration/fixtures/*.pdf
!tests/integration/banks/**/*.pdf
!monopoly/examples/*.pdf

# john files
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
13 changes: 6 additions & 7 deletions tests/integration/banks/test_banks.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from datetime import datetime
from pathlib import Path

import pandas as pd
import pytest
Expand All @@ -22,13 +23,11 @@
)
def test_bank_operations(bank_class: BankBase, total_amount, statement_date):
bank_name = bank_class.statement_config.bank_name
bank: BankBase = bank_class(
file_path=f"tests/integration/fixtures/{bank_name}/input.pdf"
)
raw_data = pd.read_csv(f"tests/integration/fixtures/{bank_name}/raw.csv")
transformed_data = pd.read_csv(
f"tests/integration/fixtures/{bank_name}/transformed.csv"
)

fixture_directory = Path(__file__).parent / bank_name
bank: BankBase = bank_class(file_path=fixture_directory / "input.pdf")
raw_data = pd.read_csv(fixture_directory / "raw.csv")
transformed_data = pd.read_csv(fixture_directory / "transformed.csv")

# Check extracted data is correct
statement: Statement = bank.extract()
Expand Down
83 changes: 0 additions & 83 deletions tests/integration/fixtures/citibank/raw.csv

This file was deleted.

83 changes: 0 additions & 83 deletions tests/integration/fixtures/citibank/transformed.csv

This file was deleted.

72 changes: 0 additions & 72 deletions tests/integration/fixtures/dbs/raw.csv

This file was deleted.

72 changes: 0 additions & 72 deletions tests/integration/fixtures/dbs/transformed.csv

This file was deleted.

18 changes: 0 additions & 18 deletions tests/integration/fixtures/hsbc/raw.csv

This file was deleted.

18 changes: 0 additions & 18 deletions tests/integration/fixtures/hsbc/transformed.csv

This file was deleted.

Loading

0 comments on commit 10ac6a7

Please sign in to comment.