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')
def test_if_date_is_valid(self): self.assertTrue(Loan.isDateValid('12-Mar-2016')) self.assertFalse(Loan.isDateValid('12-Mak-2016'))