From c8dffd8a8d7b38fef6d5681b51eeb4a381f0cc80 Mon Sep 17 00:00:00 2001 From: sb Date: Sun, 9 Feb 2020 17:03:00 -0500 Subject: [PATCH 1/2] adding test for default solution to PerfForesightConsumerType. See #504 --- HARK/tests/test_PerfForesightConsumerType.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 HARK/tests/test_PerfForesightConsumerType.py diff --git a/HARK/tests/test_PerfForesightConsumerType.py b/HARK/tests/test_PerfForesightConsumerType.py new file mode 100644 index 000000000..049c0fee0 --- /dev/null +++ b/HARK/tests/test_PerfForesightConsumerType.py @@ -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) + + From cf4972fad57afb09ec46f2c8a4c801d17934c538 Mon Sep 17 00:00:00 2001 From: sb Date: Wed, 26 Feb 2020 13:22:45 -0500 Subject: [PATCH 2/2] moving test_PerfForesightConsumerType to ConsumptionSaving/tests/ --- .../tests/test_PerfForesightConsumerType.py | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename HARK/{ => ConsumptionSaving}/tests/test_PerfForesightConsumerType.py (100%) diff --git a/HARK/tests/test_PerfForesightConsumerType.py b/HARK/ConsumptionSaving/tests/test_PerfForesightConsumerType.py similarity index 100% rename from HARK/tests/test_PerfForesightConsumerType.py rename to HARK/ConsumptionSaving/tests/test_PerfForesightConsumerType.py