示例#1
0
import bank

sa = bank.SA('Aditya')
print(sa.n, sa.b)
sa.credit(100)
try:
    sa.debit(2000)
except bank.InsufficientBalanceError as err:
    print("Please check you balance or try after sometime")
except Exception as err:
    print("Transaction failed. Please contact admin")

print(sa.n, sa.b)

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

#ac1 = bank.Account('Aditya')
#print(ac1.n, ac1.b)
#ac1.debit(100)
#print(ac1.n, ac1.b)
#ac1.credit(1000000)
#print(ac1.n, ac1.b)
示例#2
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')
示例#3
0
 def test_ca_account_creation(self):
     ca = bank.CA('abc inc')
     assert ca.b == 10, 'def balance should be 10'
示例#4
0
 def test_ca_account_credit(self):
     ca = bank.CA('abc inc')
     ca.credit(100)
     assert ca.b == 100, 'def balance should be 10'
示例#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
示例#6
0
 def test_cacredit(self):
     ca = bank.CA('ABC Inc.')
     ca.credit(100)
     assert ca.b == 100, "US102: default balance is 0"
示例#7
0
 def test_cacreate(self):
     ca = bank.CA('ABC Inc.')
     assert ca.b == 0, "US102: default balance is 0"
示例#8
0
 def test_ca_create(self):
     ca = bank.CA('Aditya')
     assert ca.b == 0, "US102: default bal should be 0"
示例#9
0
 def test_ca_credit(self):
     ca = bank.CA('Aditya')
     ca.credit(100)
     assert ca.b == 100, "US103: default bal should be 100"