add test of the solution terminal in the LifecycleExample
@@ -35,7 +35,13 @@ class testIndShockConsumerType(unittest.TestCase):
LifecycleExample.cycles = 1
LifecycleExample.solve()
- solver = ConsIndShockSolverBasic(LifecycleExample.solution[1],
+ # test the solution_terminal
+ self.assertAlmostEqual(
+ LifecycleExample.solution[10].cFunc(2).tolist(),
+ 2)
+
+ solver = ConsIndShockSolverBasic(
+ LifecycleExample.solution[-2],
LifecycleExample.IncomeDstn[0],
LifecycleExample.LivPrb[0],
LifecycleExample.DiscFac,
