Skip to content

Commit cfc67ec

Browse files
committed
Minor edits
1 parent 3c13344 commit cfc67ec

7 files changed

+83
-113
lines changed

tests/test_configuration.py

-2
Original file line numberDiff line numberDiff line change
@@ -311,8 +311,6 @@ def test_internal_id(self) -> None:
311311

312312
with self.assertRaisesRegex(RP2TypeError, "Parameter name is not a string: .*"):
313313
self._configuration.type_check_internal_id(None, 10) # type: ignore
314-
with self.assertRaisesRegex(RP2ValueError, "Parameter 'internal_id' has non-positive value .*"):
315-
self._configuration.type_check_internal_id("internal_id", -23)
316314
with self.assertRaisesRegex(RP2TypeError, "Parameter 'internal_id' has non-integer value .*"):
317315
self._configuration.type_check_internal_id("internal_id", 7.7) # type: ignore
318316
with self.assertRaisesRegex(RP2TypeError, "Parameter 'internal_id' has non-integer value .*"):

tests/test_gain_loss.py

+7-7
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,9 @@ def setUp(self) -> None:
4747
"BuY",
4848
RP2Decimal("10000"),
4949
RP2Decimal("2.0002"),
50-
RP2Decimal("20"),
51-
RP2Decimal("20002"),
52-
RP2Decimal("20022"),
50+
fiat_fee=RP2Decimal("20"),
51+
fiat_in_no_fee=RP2Decimal("20002"),
52+
fiat_in_with_fee=RP2Decimal("20022"),
5353
internal_id=10,
5454
)
5555
self._in_buy2 = InTransaction(
@@ -61,7 +61,7 @@ def setUp(self) -> None:
6161
"BuY",
6262
RP2Decimal("10500"),
6363
RP2Decimal("0.8"),
64-
RP2Decimal("10"),
64+
fiat_fee=RP2Decimal("10"),
6565
internal_id=11,
6666
)
6767
self._in_buy3 = InTransaction(
@@ -73,7 +73,7 @@ def setUp(self) -> None:
7373
"BuY",
7474
RP2Decimal("1300"),
7575
RP2Decimal("1.5"),
76-
RP2Decimal("20"),
76+
fiat_fee=RP2Decimal("20"),
7777
internal_id=12,
7878
)
7979
self._in_interest = InTransaction(
@@ -85,7 +85,7 @@ def setUp(self) -> None:
8585
"interest",
8686
RP2Decimal("11000"),
8787
RP2Decimal("0.1"),
88-
RP2Decimal("0"),
88+
fiat_fee=RP2Decimal("0"),
8989
internal_id=14,
9090
)
9191
self._out: OutTransaction = OutTransaction(
@@ -319,7 +319,7 @@ def test_bad_gain_loss(self) -> None:
319319
"BuY",
320320
RP2Decimal("1300"),
321321
RP2Decimal("1.5"),
322-
RP2Decimal("20"),
322+
fiat_fee=RP2Decimal("20"),
323323
internal_id=11,
324324
)
325325
GainLoss(self._configuration, self._accounting_method, RP2Decimal("0.1"), self._out, in_transaction)

tests/test_gain_loss_set.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ def _initialize_transactions(cls, asset: str) -> None:
9494
"BUY",
9595
RP2Decimal("11000"),
9696
RP2Decimal("1"),
97-
RP2Decimal("100.00"),
97+
fiat_fee=RP2Decimal("100.00"),
9898
internal_id=4,
9999
)
100100
cls._in2[asset] = InTransaction(
@@ -106,7 +106,7 @@ def _initialize_transactions(cls, asset: str) -> None:
106106
"INTEREST",
107107
RP2Decimal("12000.0"),
108108
RP2Decimal("2.0"),
109-
RP2Decimal("0"),
109+
fiat_fee=RP2Decimal("0"),
110110
internal_id=3,
111111
)
112112
cls._in6[asset] = InTransaction(
@@ -118,7 +118,7 @@ def _initialize_transactions(cls, asset: str) -> None:
118118
"INTEREST",
119119
RP2Decimal("13000.0"),
120120
RP2Decimal("3"),
121-
RP2Decimal("0"),
121+
fiat_fee=RP2Decimal("0"),
122122
internal_id=7,
123123
)
124124
cls._in5[asset] = InTransaction(
@@ -130,7 +130,7 @@ def _initialize_transactions(cls, asset: str) -> None:
130130
"BUY",
131131
RP2Decimal("14000.0"),
132132
RP2Decimal("4.0"),
133-
RP2Decimal("400"),
133+
fiat_fee=RP2Decimal("400"),
134134
internal_id=6,
135135
)
136136
cls._in4[asset] = InTransaction(
@@ -142,7 +142,7 @@ def _initialize_transactions(cls, asset: str) -> None:
142142
"BUY",
143143
RP2Decimal("15000.0"),
144144
RP2Decimal("5.0"),
145-
RP2Decimal("500"),
145+
fiat_fee=RP2Decimal("500"),
146146
internal_id=5,
147147
)
148148
cls._out15[asset] = OutTransaction(
@@ -390,7 +390,7 @@ def test_bad_gain_loss_set(self) -> None:
390390
"INTEREST",
391391
RP2Decimal("12000.0"),
392392
RP2Decimal("2.0"),
393-
RP2Decimal("0"),
393+
fiat_fee=RP2Decimal("0"),
394394
internal_id=3,
395395
)
396396
gain_loss_set.add_entry(GainLoss(self._configuration, self._accounting_method, RP2Decimal("0.2"), out15, in_transaction_test))

0 commit comments

Comments
 (0)