Skip to content

Commit

Permalink
Added a few comments
Browse files Browse the repository at this point in the history
  • Loading branch information
eprbell committed Feb 2, 2025
1 parent ab53be4 commit 322a152
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tests/transfer_analysis_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,23 @@

@dataclass(frozen=True, eq=True)
class _Test:
# English description of the test.
description: str
# List of universal-application, input transactions.
input: List[AbstractTransactionDescriptor]
# Dictionary of expected per-wallet, input transactions: this is the wanted output of transfer analysis.
want: Dict[Account, List[AbstractTransactionDescriptor]]
# Dictionary of expected actual amounts: this contains the actual crypto amounts of the per-wallet in-transactions. It is useful to understand
# where the funds are, because in per-wallet application there can be multiple in-transactions covering the same funds in different exchanges:
# artificial in-transactions are created when processing intra-transactions to model the reception of funds).
want_amounts: Dict[Account, Dict[str, int]]
# If not empty, the test is expected to raise an error and this is the expected error message.
want_error: str


class AbstractTransferAnalysis(AbstractTestTransactionProcessing):

# Run a transfer analysis test.
def _run_test(self, test: _Test, transfer_semantics: AbstractAccountingMethod) -> None:
print(f"\nDescription: {test.description:}\nTransfer: {transfer_semantics}\nWant error: {'yes' if test.want_error else 'no'}")
configuration = Configuration("./config/test_data.ini", US())
Expand Down

0 comments on commit 322a152

Please sign in to comment.