diff --git a/tests/transfer_analysis_common.py b/tests/transfer_analysis_common.py index a3d8a3e..ff6fc6f 100644 --- a/tests/transfer_analysis_common.py +++ b/tests/transfer_analysis_common.py @@ -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())