Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simple test of initialization of IncomeDstn of IndShockConsumerType. #256

Merged
merged 4 commits into from
May 14, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions HARK/tests/test_ConsIndShockInit.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
"""
This file tests whether ConsIndShockModel's are initialized correctly.
"""


# Bring in modules we need
import unittest
import numpy as np
import HARK.ConsumptionSaving.ConsumerParameters as Params
from HARK.ConsumptionSaving.ConsIndShockModel import IndShockConsumerType
from HARK.utilities import plotFuncsDer, plotFuncs


class testsForConsIndShockModelInitialization(unittest.TestCase):
# We don't need a setUp method for the tests to run, but it's convenient
# if we want to test various things on the same model in different test_*
# methods.
def setUp(self):

# Make and solve an idiosyncratic shocks consumer with a finite lifecycle
LifecycleExample = IndShockConsumerType(**Params.init_lifecycle)
self.model = LifecycleExample

def test_LifecycleIncomeProcess(self):
self.assertEqual(len(self.model.IncomeDstn), self.model.T_cycle)