Beispiel #1
0
    def test_earliest_start_date(self):
        timeline = Timeline(util.nov1)
        work_slot, _ = timeline.find_slot(4, 1.5)

        w1 = Work(1)
        w1.title = 'w1'
        w1.effort_left_d = 1.0
        w1.assignee_id = 100
        w1.schedule(timeline.find_slot(0, 1)[0])

        w2 = Work(2)
        w2.title = 'w2'
        w2.effort_left_d = 1.0
        w2.assignee_id = 101
        w2.schedule(timeline.find_slot(1, 3)[0])

        w3 = Work(3)
        w3.title = 'w3'
        w3.effort_left_d = 1.0
        w3.prereqs = [1, 2]
        w3.assignee_id = 200

        work_dict = {1: w1, 2: w2, 3: w3}
        self.assertEqual(util.nov7, w3.earliest_start_date(work_dict, util.nov1))
        return
Beispiel #2
0
def construct_work(id, title, effort_left_d, prereqs, assignee_id, key_date):
    result = Work(id)
    result.title = title
    result.effort_left_d = effort_left_d
    result.prereqs = prereqs
    result.assignee_id = assignee_id
    result.key_date = key_date
    return result
Beispiel #3
0
def construct_work(id, title, effort_left_d, prereqs, assignee_id, key_date):
    result = Work(id)
    result.title = title
    result.effort_left_d = effort_left_d
    result.prereqs = prereqs
    result.assignee_id = assignee_id
    result.key_date = key_date
    return result
Beispiel #4
0
def fields_to_work_object(fields):
    result = Work(fields['id'])
    for f in fields.keys():
        if f == 'title':
            result.title = fields[f]
        elif f == 'assignee_id' or f == 'person_id':
            result.assignee_id = fields[f]
        elif f == 'project_name':
            result.project_name = fields[f]
        elif f == 'project_id':
            result.project_id = fields[f]

        elif f == 'effort_left_d':
            result.effort_left_d = float(fields[f])
        elif f == 'prereqs':
            result.prereqs = dovetail.util.condition_prereqs(fields[f])

        elif f == 'key_date':
            result.key_date = dovetail.util.condition_date(fields[f])
        elif f == 'start_date':
            result.start_date = dovetail.util.condition_date(fields[f])
        elif f == 'end_date':
            result.end_date = dovetail.util.condition_date(fields[f])
    return result
Beispiel #5
0
def fields_to_work_object(fields):
    result = Work(fields['id'])
    for f in fields.keys():
        if f == 'title':
            result.title = fields[f]
        elif f == 'assignee_id' or f == 'person_id':
            result.assignee_id = fields[f]
        elif f == 'project_name':
            result.project_name = fields[f]
        elif f == 'project_id':
            result.project_id = fields[f]

        elif f == 'effort_left_d':
            result.effort_left_d = float(fields[f])
        elif f == 'prereqs':
            result.prereqs = dovetail.util.condition_prereqs(fields[f])

        elif f == 'key_date':
            result.key_date = dovetail.util.condition_date(fields[f])
        elif f == 'start_date':
            result.start_date = dovetail.util.condition_date(fields[f])
        elif f == 'end_date':
            result.end_date = dovetail.util.condition_date(fields[f])
    return result