From 9f6522352fd72daf2afc713b6fc739c17ad92eaf Mon Sep 17 00:00:00 2001 From: "JHM Darbyshire (win11)" Date: Tue, 28 Jan 2025 16:26:15 +0100 Subject: [PATCH] REF: amend cache_states to decorators --- python/tests/test_fx_volatility.py | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/python/tests/test_fx_volatility.py b/python/tests/test_fx_volatility.py index 25af52cf..27003ccd 100644 --- a/python/tests/test_fx_volatility.py +++ b/python/tests/test_fx_volatility.py @@ -762,10 +762,24 @@ def test_surface_validate_states(self): assert pre_state != post_state # validate states has been run and updated the state. def test_initialisation_state_smile(self): - assert False + smile = FXDeltaVolSmile( + nodes={0.25: 10.0, 0.5: 10.0, 0.75: 11.0}, + delta_type="forward", + eval_date=dt(2023, 3, 16), + expiry=dt(2023, 6, 16), + id="vol", + ) + assert smile._state != 0 def test_initialisation_state_surface(self): - assert False + surf = FXDeltaVolSurface( + expiries=[dt(2000, 1, 1), dt(2001, 1, 1)], + delta_indexes=[0.5], + node_values=[[10.0], [9.0]], + eval_date=dt(1999, 1, 1), + delta_type="forward", + ) + assert surf._state != 0 def test_validate_delta_type() -> None: with pytest.raises(ValueError, match="`delta_type` must be in"):