The total credit property should not be converted into a negative value.
When parsing the account end line (the one that starts with '33'), there is a check to verify that the total_credit (the total amount of credit transactions) matches the amount in this end line.
The key part to examine is the following line:
def _parse_account_end(self, line, account):
assert account.bank_code == line[2:6]
assert account.branch_code == line[6:10]
assert account.number == line[10:20]
assert account.number_of_debit == int(line[20:25])
assert account.total_debit == Decimal(line[25:39]) / 100
assert account.number_of_credit == int(line[39:44])
assert account.total_credit == Decimal(line[44:58]) / 100 <---
As mentioned earlier, this assertion checks that the amount in the line (from position 44 to 58, which is always positive) is equal to the total_credit property:
@property
def total_credit(self):
return -sum((t.amount for t in self.transactions if t.amount > 0))
As far as I know, this property will always return a negative value or zero. Therefore, the test will always pass if there are no credit transactions (i.e., assert 0 == 0).
Unfortunately, the test does not check anything related to the end line.