Ejemplo n.º 1
0
 def test_id_doesnt_exist(self):
     service.TASKS = TASKS
     task_id = 2
     result_task = service.get_task(task_id)
     self.assertFalse(result_task)
Ejemplo n.º 2
0
 def test_id_exists(self):
     service.TASKS = TASKS
     task_id = TASK_ID
     result_task = service.get_task(task_id)
     self.assertEqual(result_task, TASK_TEXT)
Ejemplo n.º 3
0
def test_get_task_id_exists(tasks):
    result_task = service.get_task(TASK_ID)
    assert result_task == TASK_TEXT
Ejemplo n.º 4
0
def test_get_task_doesnt_exist(tasks):
    result_task = service.get_task(2)
    assert result_task is None
Ejemplo n.º 5
0
def task_by_id(task_id):
    task = get_task(task_id)
    if not task:
        raise APIException("Task doesn't exist")
    return jsonify(task=task)