def test_define_money(self): """ define moneay depends of weekday :return: money Float """ format_time = lambda hour: datetime.strptime(hour, '%H:%M') money = payroll("file.txt").define_money(format_time('09:00'), 'MO') self.assertEqual(money, 25)
def test_init(self): self.assertEqual(payroll("file.txt").file, "file.txt")
def test_define_payroll(self): self.assertEqual( payroll("file.txt").define_payroll('MO', '10:00', '12:00'), 75)
def test_process_payroll(self): roll = payroll("file.txt").process_payroll() self.assertEqual(roll, None)
import sys from payroll import hr_payroll as payroll if __name__ == "__main__": payroll = payroll.payroll(sys.argv[1]) payroll.process_payroll()