Пример #1
0
def test_total_pay_mixed() -> None:
    e = SalariedEmployee(14, 'Gilbert the cat', 1200.0)
    f = HourlyEmployee(25, 'Chairman Meow', 500.25, 1.0)
    e.pay(date(2018, 6, 28))
    e.pay(date(2018, 7, 28))
    f.pay(date(2018, 8, 28))
    assert e.total_pay() == 200.0
    assert f.total_pay() == 500.25
Пример #2
0
def test_total_payroll_mixed() -> None:
    my_corp = Company([
        SalariedEmployee(24, 'Gilbert the cat', 1200.0),
        HourlyEmployee(25, 'Chairman Meow', 500.25, 1.0)
    ])
    my_corp.pay_all(date(2018, 6, 28))
    my_corp.pay_all(date(2018, 7, 26))
    SalariedEmployee(24, 'Gilbert the cat', 1200.0).pay(date(2018, 7, 28))
    assert my_corp.total_payroll() == 600.25 * 2
Пример #3
0
def test_total_pay_basic() -> None:
    e = SalariedEmployee(14, 'Gilbert the cat', 1200)
    e.pay(date(2018, 6, 28))
    e.pay(date(2018, 7, 28))
    e.pay(date(2018, 8, 28))
    assert e.total_pay() == 300.0
Пример #4
0
def test_total_pay_basic() -> None:
    e = SalariedEmployee(14, 'Gilbert the cat', 1200.0)
    e.pay(date(2018, 6, 28))
    e.pay(date(2018, 7, 28))
    e.pay(date(2018, 8, 28))
    assert e.total_pay() == 300.0
    e = HourlyEmployee(11, 'a', 0, 1.0)
    e.pay(date(2018, 6, 28))
    assert e.total_pay() == 0
    e = HourlyEmployee(11, 'a', 40, 19.0)
    e.pay(date(2018, 6, 28))
    e.pay(date(2018, 7, 28))
    e.pay(date(2018, 8, 28))
    assert e.total_pay() == 2280
    e = HourlyEmployee(11, 'a', 40, 19.0)
    assert e.total_pay() == 0