Exemplo n.º 1
0
import bank

sa = bank.SA('Aditya')
print(sa.n, sa.b, sa.t)
sa.credit(100)
print(sa.n, sa.b, sa.t)
try:
    sa.debit(2000)
except bank.InsufficientFundsError as err:
    print("Please check your balance and try again!")

ca = bank.CA('ABC Inc')
print(ca.n, ca.b, ca.t)
ca.credit(100)
print(ca.n, ca.b, ca.t)
ca.debit(2000)
print(ca.n, ca.b, ca.t)

#ac1 = bank.Account("A", 100, 'c')
Exemplo n.º 2
0
 def test_sa_account_credit(self):
     sa = bank.SA('Aditya')
     sa.credit(100)
     assert sa.b == 200, 'def balance should be 100'
Exemplo n.º 3
0
 def test_sa_account_creation(self):
     sa = bank.SA('Aditya')
     assert sa.b == 100, 'def balance should be 100'
Exemplo n.º 4
0
 def test_insufficient(self):
     sa = bank.SA('Aditya', 10, 'S')
     try:
         sa.debit(100)
     except ValueError as err:
         assert err.message == 'Insufficient Balance'
Exemplo n.º 5
0
# ac = bank.Account('Aditya', 10000, 'S')
# print ac.n, ac.b, ac.t
# print ac
# ac.credit(1000000)
# ac.debit(100)
# print ac.b
#
# ac1 = bank.Account('Arun')
# print ac1.n, ac1.b, ac1.t
# print ac1
# ac1.credit(1000)
# ac1.debit(5000)
# print ac1.b

import bank
sa = bank.SA('Aditya', 1000, 'S')

if sa.b > 2000:
    sa.debit(2000)

ca = bank.CA('ABC Pvt Ltd', 0, 'C')
ca.debit(1000)
print "Balance of SA", sa.b
print "Balance of CA", ca.b
Exemplo n.º 6
0
 def test_SA(self):
     sa = bank.SA('Aditya', 1000, 'S')
     assert sa.b == 1000, 'Was expecting the balance to be 1000'
Exemplo n.º 7
0
 def test_debitSA(self):
     sa = bank.SA('Aditya', 1000, 'S')
     sa.debit(300)
     assert sa.b == 700, 'Was expecting the balance to be 700'
Exemplo n.º 8
0
 def test_sacreate(self):
     sa = bank.SA('Aditya')
     assert sa.b == 100, "US101: default balance is 100"
Exemplo n.º 9
0
 def test_sacredit(self):
     sa = bank.SA('Aditya')
     sa.credit(100)
     assert sa.b == 200, "US101: default balance is 100"
Exemplo n.º 10
0
 def test_sa_create(self):
     sa = bank.SA('Aditya')
     assert sa.b == 1000, "US101: default bal should be 1000"
Exemplo n.º 11
0
 def test_sa_credit(self):
     sa = bank.SA('Aditya')
     sa.credit(100)
     assert sa.b == 1100, "US103: default bal should be 1100"
Exemplo n.º 12
0
import bank

sa = bank.SA('Tahiritian')
print(sa.n, sa.b, sa.t)
sa.credit(100)
print(sa.n, sa.b, sa.t)
try:
    sa.debit(2000)
except bank.InsufficientFundsError as err:
    print("Please check your balance and try again!")

ca = bank.CA('ABC Inc')
print(ca.n, ca.b, ca.t)
ca.credit(100)
print(ca.n, ca.b, ca.t)
ca.debit(2000)
print(ca.n, ca.b, ca.t)

#ac1 = bank.Account("A", 100, 'c')