Exemplo n.º 1
0
def test_schedule(request):
    task_obj = Task(request)
    task_obj.task_id = 789801
    task_obj.project_id = 890131
    schedule_obj = task_obj.schedule()
    assert isinstance(schedule_obj, Schedule)
    assert schedule_obj.task_id == 789801
    assert schedule_obj.project_id == 890131
Exemplo n.º 2
0
def test_create_under_project(mock_task__update, mock_base_create, request):
    title = 'auto_task'
    type = 'noncap_nonbill'
    project_id = None
    Task(request).create_under_project(title, type)
    mock_base_create.assert_called_with(project_id=project_id)
    mock_task__update.assert_called_with(title=title, payload=type)
Exemplo n.º 3
0
 def task(self, title, type='noncap_nonbill'):
     """
     Task is created, which defines a relationship between project and task
     :param title:
     :param type:
     :return:
     """
     obj = Task(self.request).create_under_project(
         title, type, project_id=self.project_id)
     return obj
Exemplo n.º 4
0
 def multipletasks(self, title_lst):
     """
     Purpose of this function is to create a list of tasks
     """
     obj = Task(self.request)._multipletasks(title_lst)
     return obj
Exemplo n.º 5
0
def test_create(mock_task_create_under_project, request):
    title = 'auto_task'
    type = 'noncap_nonbill'
    Task(request).create(title, type)
    mock_task_create_under_project.assert_called_with(title, type)
Exemplo n.º 6
0
def test_set_complete_date(mock__update, request):
    complete_date_time = '16-07-2018T00:00:00.000'
    Task(request).set_complete_date(complete_date_time)
    mock__update.assert_called_with(payload='completed_date',
                                    complete_date_time=complete_date_time)
Exemplo n.º 7
0
def test_set_start_date(mock__update, request):
    start_date_time = '16-07-2018T00:00:00.000'
    Task(request).set_start_date(start_date_time)
    mock__update.assert_called_with(payload='start_date',
                                    start_date_time=start_date_time)
Exemplo n.º 8
0
def test_set_duration(mock__update, request):
    duration = 28800
    Task(request).set_duration(duration)
    mock__update.assert_called_with(payload='duration', duration=duration)
Exemplo n.º 9
0
def test_set_status(mock__update, request):
    status = 'HOLD'
    Task(request).set_status(status)
    mock__update.assert_called_with(payload='status',
                                    status_id=1040991875,
                                    status_value='Hold')
Exemplo n.º 10
0
def test_set_description(mock__update, request):
    description = 'auto_description'
    Task(request).set_description(description)
    mock__update.assert_called_with(payload='description',
                                    description=description)
Exemplo n.º 11
0
def test_set_title(mock__update, request):
    title = 'auto_project'
    Task(request).set_title(title)
    mock__update.assert_called_with(payload='title', title=title)