Skip to content

Commit

Permalink
Merge pull request #506 from sbenthall/i504-unittests
Browse files Browse the repository at this point in the history
adding test for default solution to PerfForesightConsumerType
  • Loading branch information
sbenthall authored Feb 26, 2020
2 parents 78210a5 + cf4972f commit 1c81bff
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions HARK/ConsumptionSaving/tests/test_PerfForesightConsumerType.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
from HARK.ConsumptionSaving.ConsIndShockModel import PerfForesightConsumerType

import unittest

class testPerfForesightConsumerType(unittest.TestCase):

def test_default_solution(self):
agent = PerfForesightConsumerType()
agent.solve()
c = agent.solution[0].cFunc

self.assertEqual(c.x_list[0], -0.9805825242718447)
self.assertEqual(c.x_list[1], 0.01941747572815533)
self.assertEqual(c.y_list[0], 0)
self.assertEqual(c.y_list[1], 0.511321002804608)
self.assertEqual(c.decay_extrap, False)


0 comments on commit 1c81bff

Please sign in to comment.