def test_typing(self): b = SubmitSmRespBill(self.user) self.assertRaises(InvalidBillKeyError, b.getAmount, 'anyKey') self.assertRaises(InvalidBillKeyError, b.getAction, 'anyKey') self.assertRaises(InvalidBillKeyError, b.setAmount, 'anyKey', 0) self.assertRaises(InvalidBillKeyError, b.setAction, 'anyKey', 0) self.assertRaises(InvalidBillValueError, b.setAmount, 'submit_sm_resp', 'A')
def test_amounts(self): b = SubmitSmRespBill(self.user) b.setAmount('submit_sm_resp', 2) self.assertEqual(b.getAmount('submit_sm_resp'), 2) self.assertEqual(b.getTotalAmounts(), 2)
def test_default(self): b = SubmitSmRespBill(self.user) self.assertEqual(b.getAmount('submit_sm_resp'), 0.0) self.assertNotEquals(b.bid, None) self.assertEqual(b.user, self.user)