def tearDown(self): i.close_acc() i.trans('TM_BANK') i.idle() super(AccountTestCase, self).tearDown()
def test_invalid_trans(self): expected = "531 Invalid account state\n" i.open_acc() response = i.trans('TM_BANK') return self.assertEqual(expected, response)
def test_valid_below(self): i.art_reg(59922827, 1) i.close_acc() response = i.trans('TM_BANK', 3) return self.assertEqual(response, "240 3,99 Transaction succeeded\n")
def test_valid_exact(self): i.art_reg(59922827, 1) i.close_acc() response = i.trans('TM_BANK', 6, 99) return self.assertEqual(response, "240 0,00 Transaction succeeded\n")
def test_valid_neg_699(self): i.art_reg(59922827, 1) i.close_acc() response = i.trans('TM_CASH', -10) return self.assertEqual(response, "240 16,99 Transaction succeeded\n")
def test_valid_above(self): i.art_reg(59922827, 1) i.close_acc() response = i.trans('TM_BANK', 20) return self.assertEqual(response, "240 -13,01 Transaction succeeded\n")
def test_valid_negamnt(self): i.close_acc() response = i.trans('TM_BANK', -10) return self.assertEqual(response, "542 FI AMOUNT Transaction failed\n")
def test_invalid_method2(self): i.close_acc() response = i.trans('TM_CASHasd123') return self.assertEqual(response, "540 No Such Transaction method\n")
def test_valid_mthd(self): i.close_acc() response = i.trans('TM_BANK') return self.assertEqual(response, "240 0,00 Transaction succeeded\n")
def tearDown(self): i.trans('TM_CASH') i.idle() i.sign_off()
def up_to_trans(method='TM_BANK'): up_to_close() return i.trans(method)