def test_deposit_withdrawals(self): self.banks, self.econ, self.simInfo = setup_banks1() # gives 5 banks with the following: # total investments: 0 50, 1 20, 2 40, 3 30, 4 80 # lending: 0 10, 1 10, 2 20, 3 30, 4 40 # borrowing: 0 100, 1 1, 2 2, 3 3, 4 4 # cash: 0 50, 1 20, 2 15, 3 10, 4 5 # deposits: 0 10, 1 20, 2 30, 3 40, 4 50 # liabilities: 0 110, 1 21, 2 32, 3 43, 4 54 # assets: 0 110, 1 50, 2 75, 3 70, 4 125 # capital: 0 0, 1 29, 2 43, 3 27, 4 71 self.simInfo.updateCount = 2 self.econ.do_deposit_withdrawals(0.2) for b, d, c in zip(range(5), [8, 16, 24, 32, 40], [48, 16, 9, 2, -5]): dep = self.banks[b].deposits cash = self.banks[b].cash eq_(d, dep, "Bank %r deposits should be %r but is %r (1)" % (b, d, dep)) eq_(c, cash, "Bank %r cash should be %r but is %r (1)" % (b, c, cash))
def test_withdraw_wrong2(self): self.banks, self.econ, self.simInfo= setup_banks1() self.simInfo.updateCount = 3 self.econ.do_deposit_withdrawals(1.2)
def setUp(self): self.banks, self.econ, self.simInfo = setup_banks1()