diff options
| author | Max Nanis | 2026-08-24 16:04:11 -0700 |
|---|---|---|
| committer | Max Nanis | 2026-08-24 16:04:11 -0700 |
| commit | 979efd01b0c61d493d1fef3dff9885f5d38a8975 (patch) | |
| tree | 1f56c05b4736636f0f5f82678bc06994bd0a4403 /tests/models/test_currency.py | |
| parent | e2c5de703be45746bacaea4136f24440ff5a291c (diff) | |
| download | generalresearch-979efd01b0c61d493d1fef3dff9885f5d38a8975.tar.gz generalresearch-979efd01b0c61d493d1fef3dff9885f5d38a8975.zip | |
ruff + fix filepath_adapter
Diffstat (limited to 'tests/models/test_currency.py')
| -rw-r--r-- | tests/models/test_currency.py | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/tests/models/test_currency.py b/tests/models/test_currency.py index 40cff88..1102717 100644 --- a/tests/models/test_currency.py +++ b/tests/models/test_currency.py @@ -14,7 +14,7 @@ class TestUSDCentModel: def test_construct_int(self): from generalresearch.currency import USDCent - for i in range(100): + for _ in range(100): int_val = randint(0, 999_999) instance = USDCent(int_val) assert int_val == instance @@ -102,7 +102,7 @@ class TestUSDCentModel: instance = USDCent(int_val) with pytest.raises(expected_exception=ValueError) as cm: - instance - USDCent(1_000_000) + _ = instance - USDCent(1_000_000) assert "USDCent not be less than zero" in str(cm.value) @@ -147,16 +147,16 @@ class TestUSDCentModel: instance = USDCent(int_val) with pytest.raises(expected_exception=AssertionError): - instance + 0.10 + _ = instance + 0.10 with pytest.raises(expected_exception=AssertionError): - instance + Decimal(".10") + _ = instance + Decimal(".10") with pytest.raises(expected_exception=AssertionError): - instance + "9.9" + _ = instance + "9.9" with pytest.raises(expected_exception=AssertionError): - instance + True + _ = instance + True def test_abs(self): from generalresearch.currency import USDCent @@ -248,6 +248,8 @@ class TestUSDMillModel: decimal_val: Decimal = Decimal("10.6789") instance = USDMill(decimal_val) + assert isinstance(instance, USDMill) + assert len(record) == 1 assert ( "USDMill init with a Decimal. Rounding behavior may be unexpected" |
