Beispiel #1
0
    def test_deposit_negative(self):
        test_account1 = Savings(100, 1000000)

        self.assertEquals(test_account1.deposit(-1), None)
Beispiel #2
0
    def test_deposit_none(self):
        test_account1 = Savings(100, 1000000)

        with self.assertRaises(TypeError):
            test_account1.deposit()
Beispiel #3
0
    def test_withdraw_negative(self):
        test_account1 = Savings(100, 1000000)

        self.assertEquals(test_account1.withdraw(-100), None)
Beispiel #4
0
    def test_withdraw_none(self):
        test_account1 = Savings(100, 1000000)

        with self.assertRaises(TypeError):
            test_account1.withdraw()
Beispiel #5
0
    def test_deposit_string(self):
        test_account1 = Savings(100, 1000000)

        with self.assertRaises(TypeError):
            test_account1.deposit("blahblah")
Beispiel #6
0
    def test_withdraw_string(self):
        test_account1 = Savings(100, 1000000)

        with self.assertRaises(TypeError):
            test_account1.withdraw("blah")
Beispiel #7
0
    def test_deposit(self):
        test_account1 = Savings(100, 1000000)
        test_account1.deposit(100)

        self.assertEqual(test_account1.balance, 200 + 100 * 0.02)
Beispiel #8
0
    def test_withdraw(self):
        test_account1 = Savings(100, 1000000)
        test_account1.withdraw(50)

        self.assertEqual(test_account1.balance, 45)