Ejemplo n.º 1
0
    def test_load_with_tasks(self):
        employee = Employee(**self.employee_data)
        employee.tasks = [Task(name='task_%d' % i, complexity=randint(1, 5))
                          for i in range(1, 11)]

        self.assertEqual(employee.load,
                         employee.total_cp / float(employee.cp_per_time))
Ejemplo n.º 2
0
    def test_total_cp_with_tasks(self):
        tasks = [Task(name='task_%d' % i, complexity=randint(1, 5)) for i in
                 range(1, 11)]

        employee = Employee(**self.employee_data)
        employee.tasks = tasks

        self.assertEqual(employee.total_cp,
                         sum(task.complexity for task in tasks))