@@ -20,18 +20,25 @@ def test_init_efficient_frontier_reb():
2020def test_repr (init_efficient_frontier_reb ):
2121 value = pd .Series (
2222 dict (
23- symbols = "[ SPY.US, GLD.US]" ,
23+ symbols = [ " SPY.US" , " GLD.US" ] ,
2424 currency = "USD" ,
2525 first_date = "2019-01" ,
2626 last_date = "2020-02" ,
2727 period_length = "1 years, 2 months" ,
2828 rebalancing_period = "year" ,
29- inflation = "USD.INFL" ,
29+ bounds = ((0 , 1 ), (0 , 1 )),
30+ inflation = "USD.INFL"
3031 )
3132 )
3233 assert repr (init_efficient_frontier_reb ) == repr (value )
3334
3435
36+ @mark .rebalance
37+ @mark .frontier
38+ def test_bounds_frontier (init_bounds_frontier ):
39+ assert init_bounds_frontier .bounds == ((0 , 0.2 ), (0.2 , 0.4 ), (0.4 , 0.6 ), (0 , 1 ), (0 , 1 ))
40+
41+
3542@mark .rebalance
3643@mark .frontier
3744def test_gmv_annual_weights (init_efficient_frontier_reb ):
@@ -75,6 +82,7 @@ def test_convex_right_frontier(init_convex_frontier):
7582
7683 assert result == expected_result
7784
85+
7886@mark .rebalance
7987@mark .frontier
8088def test_nonconvex_right_frontier (init_nonconvex_frontier ):
@@ -89,6 +97,7 @@ def test_nonconvex_right_frontier(init_nonconvex_frontier):
8997
9098 assert result == expected_result
9199
100+
92101@mark .rebalance
93102@mark .frontier
94103def test_maximize_risk_with_convex_right_frontier (init_convex_frontier ):
@@ -100,6 +109,7 @@ def test_maximize_risk_with_convex_right_frontier(init_convex_frontier):
100109
101110 assert result_risk == expected_risk
102111
112+
103113@mark .rebalance
104114@mark .frontier
105115def test_maximize_risk_with_nonconvex_right_frontier (init_nonconvex_frontier ):
@@ -109,4 +119,4 @@ def test_maximize_risk_with_nonconvex_right_frontier(init_nonconvex_frontier):
109119 result_risk = result ['Risk' ]
110120 expected_risk = approx (0.28761107914313766 , abs = 1e-2 )
111121
112- assert result_risk == expected_risk
122+ assert result_risk == expected_risk
0 commit comments