-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
119 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
INFO: No schwab file provided | ||
INFO: No schwab Equity Award JSON file provided | ||
Parsing tests/test_data/trading212_2024/transactions.csv | ||
INFO: No mssb folder provided | ||
INFO: No sharesight file provided | ||
INFO: No raw file provided | ||
First pass completed | ||
Final portfolio: | ||
Final balance: | ||
Trading212: 1758.05 (GBP) | ||
Dividends: £0.00 | ||
Dividend taxes: £0.00 | ||
Interest: £0.00 | ||
Disposal proceeds: £3138.50 | ||
|
||
|
||
Second pass completed | ||
Portfolio at the end of 2024/2025 tax year: | ||
For tax year 2024/2025: | ||
Number of disposals: 1 | ||
Disposal proceeds: £3138.50 | ||
Allowable costs: £2381.35 | ||
Capital gain: £757.15 | ||
Capital loss: £0.00 | ||
Total capital gain: £757.15 | ||
Taxable capital gain: £0 | ||
|
||
Generate calculations report | ||
All done! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
Action,Time,ISIN,Ticker,Name,No. of shares,Price / share,Currency (Price / share),Exchange rate,Result,Currency (Result),Total,Currency (Total),Withholding tax,Currency (Withholding tax),Transaction fee,Notes,ID,Currency conversion fee,Currency (Currency conversion fee),Currency (Transaction fee) | ||
Deposit,2024-01-01 00:15:20.149,,,,,,,,,,3000.00,"GBP",,,,"Transaction ID: xxxxxxxxxxxx05",xxxxxxxxxxxx05,,, | ||
Market buy,2024-01-01 16:10:05.175,US00000003,FOO,"Foo Company",24.0000000000,124.01,USD,1.25229,,"GBP",2381.35,"GBP",,,,,EOF999999099,4.71,"GBP", | ||
Interest on cash,2024-01-01 11:05:03.126,,,,,,,,,,0.04,"GBP",,,,"Interest on cash",ffffffff-ffff-ffff-ffff-ffffffffffff,,, | ||
Deposit,2024-01-03 10:00:00.100,,,,,,,,,,0.75,"GBP",,,,"Withholding tax refund - interest on cash Q4 2023.",ffffffff-ffff-ffff-ffff-ffffffffff7f,,, | ||
Dividend (Dividend),2024-03-23 18:35:26,US00000003,FOO,"Foo Company",24.0000000000,0.03,USD,Not available,,,0.11,"GBP",0.02,USD,,,,,, | ||
Limit sell,2024-04-29 13:20:03.075,US00000003,FOO,"Foo Company",24.0000000000,164.01,USD,1.25229,-75.67,"GBP",3138.50,"GBP",,,,,EOF999999099,4.71,"GBP", | ||
Withdrawal,2024-05-26 16:18:16.235,,,,,,,,,,-2000.00,"GBP",,,,"Sent to Bank Account 99-99-99 / 9999999",ffffffff-ffff-ffff-ffff-ffffffffff99,,, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
"""Test Trading212 support.""" | ||
|
||
from pathlib import Path | ||
import subprocess | ||
import sys | ||
|
||
|
||
def test_run_with_trading212_files() -> None: | ||
"""Runs the script and verifies it doesn't fail.""" | ||
cmd = [ | ||
sys.executable, | ||
"-m", | ||
"cgt_calc.main", | ||
"--year", | ||
"2024", | ||
"--trading212", | ||
"tests/test_data/trading212_2024/", | ||
"--no-pdflatex", | ||
] | ||
result = subprocess.run(cmd, check=True, capture_output=True) | ||
assert result.stderr == b"", "Run with example files generated errors" | ||
expected_file = ( | ||
Path("tests") / "test_data" / "trading212_2024" / "expected_output.txt" | ||
) | ||
expected = expected_file.read_text() | ||
cmd_str = " ".join([param if param else "''" for param in cmd]) | ||
assert result.stdout.decode("utf-8") == expected, ( | ||
"Run with example files generated unexpected outputs, " | ||
"if you added new features update the test with:\n" | ||
f"{cmd_str} > {expected_file}" | ||
) |