Esempio n. 1
0
def processInput(line):
    msisdn, network, loan_date, product, amount = line.split(',')
    msisdn = msisdn.strip("'")
    network = network.strip("'").strip().lower()
    loan_date = loan_date.strip("'")
    product = product.strip("'").strip().lower()
    amount = amount.strip("'")
    if (Loan.isAmountValid(amount) and Loan.isDateValid(loan_date)):
        month_year = Loan.extractMonthYearFromDate(loan_date)
        tempLoan = Loan(msisdn, network, month_year, product, amount)
        sys.stdout.write(tempLoan.display() + '\n')
Esempio n. 2
0
 def test_if_amount_is_valid(self):
     self.assertTrue(Loan.isAmountValid('4000'))
     self.assertFalse(Loan.isAmountValid('45i'))