Esempio n. 1
0
def test_report_none():
    """

    :return:
    """
    w2 = tasks.Log("Tony", 'Task4')
    assert w2.report() == "Worker or Task doesnt exists"
Esempio n. 2
0
def test_report_hourly():
    """

    :return:
    """
    w1 = tasks.Log("Bill", 'Task1')
    assert w1.report() == "Please pay 50$ to Bill for Task1!"
Esempio n. 3
0
def test_report_fixed():
    """

    :return:
    """
    w2 = tasks.Log("Ted", 'Task3')
    assert w2.report() == "Please pay 500$ to Ted for Task3!"
Esempio n. 4
0
def test_report_one():
    log1 = tasks.Log()
    worker1 = tasks.Worker("Dima")
    worker2 = tasks.Worker("John")
    task1 = tasks.HourlyPaymentTask("Homework", 10, 3)
    task2 = tasks.Task("Take cup of tea", 5)
    worker1.take_task(task1, log1)
    worker2.take_task(task2, log1)
    assert log1.report() == 'Dima\t$30\nJohn\t$5'
Esempio n. 5
0
def test_report():
    # Data initialization
    w1 = tasks.Worker("Bill", 5, True)
    w2 = tasks.Worker("John", 3, True)
    t1 = tasks.HourlyTask(w1, 4, True, 4)
    t2 = tasks.FixedTask(w2, 30, True)
    p1 = tasks.HourlyPaymentPerTask(w1, t1)
    p2 = tasks.FixedPaymentPerTask(w2, t2)
    l = tasks.Log(p1, p2)
    assert l.report() == """Bill\t$20
Esempio n. 6
0
def test_report():
    worker1 = tasks.Worker("Bill")
    worker2 = tasks.Worker("John")
    log = tasks.Log()
    task_fixed = tasks.FixedPayment("build home", 20)
    task_per_h = tasks.PaymentPerHour("do nothing", 15, 2)
    worker1.take_task(task_fixed)
    worker2.take_task(task_per_h)
    worker2.confirm(task_per_h, log)
    worker1.confirm(task_fixed, log)
    assert log.report() == """Bill\t$20
Esempio n. 7
0
def test_report_one():
    log = tasks.Log()
    worker_artem = tasks.Worker("Artem")
    worker_alex = tasks.Worker("Alex")
    worker_masha = tasks.Worker("Masha")
    masha_fixet_task = tasks.Task("Task1", 300)
    fixet_task = tasks.Task("Task2", 100)
    hoyrly_task = tasks.HourlyTask("Task3", 200, 3)
    worker_masha.get_task(masha_fixet_task, log)
    worker_artem.get_task(fixet_task, log)
    worker_alex.get_task(hoyrly_task, log)
    assert log.report() == 'Masha\t$300\nArtem\t$100\nAlex\t$600'
Esempio n. 8
0
def test_report_four():
    log1 = tasks.Log()
    worker1 = tasks.Worker("Dima")
    worker2 = tasks.Worker("John")
    worker3 = tasks.Worker("Bill")
    task1 = tasks.HourlyPaymentTask("Homework", 10, 3)
    task2 = tasks.Task("Take cup of tea", 5)
    task3 = tasks.Task("Web serfing", 25)
    worker1.take_task(task1, log1)
    worker2.take_task(task2, log1)
    worker3.take_task(task3, log1)
    assert log1.report() == 'Dima\t$30\nJohn\t$5\nBill\t$25'
Esempio n. 9
0
def test_tasks_reporting():
    logg = tasks.Log()
    t1 = tasks.Task("one", 20)
    t2 = tasks.Task("two", 70)
    d = tasks.DailyPlan()
    d.create_plan(t1, t2)
    w1 = tasks.Worker("John")
    w2 = tasks.Worker("Mary")
    w2.get_task_from_dp(d)
    w2.log_task(logg, w2.get_current_task())
    w1.get_task_from_dp(d)
    w1.log_task(logg, w1.get_current_task(), 5)
    assert (logg.get_report()) == """Mary earned $70
Esempio n. 10
0
def test_report():
    w1 = tasks.Worker(1, "bill")
    w2 = tasks.Worker(2, "tom")

    t1 = tasks.FTask(1, "task1", 34)
    t2 = tasks.FTask(2, "task2", 10)
    t3 = tasks.HTask(3, "task3", 5, 10)

    l = tasks.Log()

    w1.approve(l, t2)
    w2.approve(l, t1)
    w2.approve(l, t3)
    assert l.report() == "task3,tom: 50\n" \
                         "task1,tom: 34\n" \
                         "task2,bill: 10"