Skip to content

Commit 223f844

Browse files
committed
fix test cases + minor code re-factoring
1 parent 132386e commit 223f844

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

casparser/process/cas_detailed.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def get_transaction_type(
3939
txn_type = TransactionType.STT_TAX
4040
elif "stamp" in description:
4141
txn_type = TransactionType.STAMP_DUTY_TAX
42-
elif ("segregate" in description.lower()) or ("segregation" in description.lower()):
42+
elif "segregat" in description:
4343
txn_type = TransactionType.SEGREGATION
4444
else:
4545
txn_type = TransactionType.MISC

tests/test_process.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,9 @@ def test_transaction_type(self):
4141
None,
4242
)
4343
assert get_transaction_type("Address updated", None) == (TransactionType.MISC, None)
44-
assert get_transaction_type("***STT paid ***", None) == (TransactionType.TAX, None)
44+
assert get_transaction_type("***STT paid ***", None) == (TransactionType.STT_TAX, None)
45+
assert get_transaction_type("***stamp duty***", None) == (TransactionType.STAMP_DUTY_TAX, None)
46+
assert get_transaction_type("Creation of units - Segregated portfolio", None) == (TransactionType.SEGREGATION, None)
4547
assert get_transaction_type("***Random text***", Decimal(0.0)) == (
4648
TransactionType.UNKNOWN,
4749
None,

0 commit comments

Comments
 (0)