def main(): login = userLogin() user = login.getUser() interface = GraphicInterface() app = ATM(user, interface) app.run() interface.closeInterface()
def test_bank_2(self): test_bank = Bank.Bank() test_bank.add_entry(123456789, 1234, "checking", 1000) test_bank.add_account(123456789, "savings", 1000) test_bank.add_entry(987654321, 7321, "checking", 5000) test_atm = ATM.ATM(test_bank, 10000) cash_bin_over_action = [("See Balance", 0), ("Withdraw", 30000)] # Tests cash bin excess handling on account balance self.assertEqual( test_atm(987654321, 7321, "checking", cash_bin_over_action), "Actions completed") exit_action = [("See Balance", 0), ("Leave", 0)] self.assertEqual(test_atm(987654321, 7321, "checking", exit_action), "Gracefully departed")
def test_bank_1(self): test_bank = Bank.Bank() test_bank.add_entry(123456789, 1234, "checking", 1000) test_bank.add_account(123456789, "savings", 1000) test_bank.add_entry(987654321, 7321, "checking", 5000) test_atm = ATM.ATM(test_bank, 10000) action_list = [("See Balance", 0), ("Withdraw", 40), ("Withdraw", 1000), ("Deposit", 100)] # These next test should be a correctly executing test case self.assertEqual(test_atm(987654321, 7321, "checking", action_list), "Actions completed") # Tests whether ATM handles overdraft attempt without crashing self.assertEqual(test_atm(123456789, 1234, "checking", action_list), "Actions completed") # Test incorrect PIN number self.assertEqual(test_atm(987654321, 1234, "checking", action_list), "Invalid Card or Incorrect Pin!") # Test incorrect Account number self.assertEqual(test_atm(876504321, 1234, "checking", action_list), "Invalid Card or Incorrect Pin!")
def main(): # Test Cases ''' dylan = Customer("Dylan", 19, 724, "MALE", 123, 10000, 2000) print(dylan.accessCustomerSupport()) print(dylan) money = dylan.withdrawal(123, 200) print(money) money2 = dylan.withdrawal(123, 2000) print(money2) money3 = dylan.withdrawal(123456789, 200) print(money3) dylan.deposit(5000000) dylan.deposit(5000000) print(Customer.amountOfCustomer()) del(dylan) print(Customer.amountOfCustomer()) ''' ''' dylan = Customer("Dylan", 19, 724, "MALE", 123, 10000, 2000) dylan2 = Customer("Dylan2", 19, 724, "MALE", 123, 90, 2000) print(dylan) print(dylan2) dylan.transferFunds(10, dylan2) print(dylan) print(dylan2) ''' ''' eric = Employee('Eric', 19, 7245491059, 'Male', 14, 'ewb5319', 'hello') #print(eric.paygrade()) #print(eric.accessCustomerSupport()) #print(eric.getEmployeeNumber()) #eric.changePassword() print(eric) print(Employee.employeeCount()) del(eric) print(Employee.employeeCount()) eric = Employee('Eric', 19, 7245491059, 'Male', 14, 'ewb5319', 'hello') print(eric) dude = Manager('dude', 19, 12345678, 'Male', 14, 'asdf', 'asdf') dude.givePromotion(eric, 1500) print(eric) ''' ''' dude = Manager('dude', 19, 12345678, 'Male', 14, 'asdf', 'asdf') dylan2 = Customer("Dylan", 19, 724, "MALE", 123, 10000, 2000) eric = Teller('Eric', 19, 7245491059, 'Male', 14, 1234, 1234, 'ewb5319', 'hello', dude) print(eric) print(dylan2) print(dude.seeCustomerDetails(dylan2)) print(eric.seeCustomerDetails(dylan2)) ''' ''' dylan2 = Customer("Dylan", 19, 724, "MALE", 123, 10000, 2000) print(dylan2) ATM(dylan2) print(dylan2) ''' ''' eric3 = Child('Eric', 14, 724, 'Male', 1234, 1000.50, 1000.50) print(eric3) print(Customer.amountOfCustomer()) print(Child.amountOfChildren()) eric3.deposit(500) eric3.checkChecBalance() eric3.checkSavBalance() print(eric3) ''' eric = Child('Eric', 14, 724, 'Male', 1, 1000, 1000) ATM(eric) dude = Manager('dude', 19, 12345678, 'Male', 14, 'asdf', 'asdf') print(dude.seeCustomerDetails(eric)) print(Customer.amountOfCustomer()) del eric print(Customer.amountOfCustomer()) ''' eric2 = Adult('Eric2', 19, 724, 'Male', 2, 1000, 1000) ''' ''' eric.checkChecBalance() eric2.checkChecBalance() eric.deposit(20) eric2.deposit(20) eric.checkChecBalance() eric2.checkChecBalance() eric2.childDeposit(20, eric) eric.checkChecBalance() eric2.withdrawal(2,20) eric2.checkChecBalance() ''' '''
from ATM import * if __name__ == '__main__': atm1 = ATM(1) atm2 = ATM(2) atm3 = ATM(3) atm1.deposit(11, 2500) atm2.withdraw(12, 1000) atm3.deposit(12, 7000) atm3.deposit(13, 1500) atm1.withdraw(11, 500) atm2.withdraw(13, 1500) atm2.deposit(11, 7000) atm1.deposit(13, 3500) for number in accounts.keys(): print("the account #{0} contains {1}€".format(number, atm1.balance(number)))
from ATM import * # card initialization file = open("account.txt", "r") bank = file.readline() username = file.readline() pin = int(file.readline()) balance = float(file.readline()) file.close() x = ATM(bank, username, pin, balance) # function to call the methods for basic operations on ATM def transactions(): time.sleep(1.0) print("1.Make a deposit.\n") time.sleep(1.0) print("2.Make a withdraw.\n") time.sleep(1.0) print("3.Check the current balance.\n") choice = int(input()) clear_screen() if choice == 1: x.deposit()
def test_empty_bank(self): empty_bank = Bank.Bank() empty_atm = ATM.ATM(empty_bank, 0) valid, message = empty_atm.swipe(0, 0) self.assertEqual(valid, 0)
import ATM def withdraw(ATM,request): print("Welcome to The Bank " ,self.bank_name) print("Your balance is : " ,self.balance) #Current_Balance = 0 #pvals=[100,50,10,5,2,1] #if request <= balance: #for index in pvals atm1=ATM(500,Cairo_Bank) #def withdraw(Balance,request): #Current_Balance = 0 #pvals=[100,50,10,5,2,1] #if request <= Balance: #for index in pvals: #while request - index >=0: #print("give " + str(index)) #request -= index #Current_Balance = Current_Balance+index #print ("Current_Balance is: ") , Balance - Current_Balance #else: #print "Can't give you this money !!" #Balance = 500 #print withdraw(Balance,278) #print withdraw(Balance,600) #print withdraw(Balance,5)