Skip to content

Commit

Permalink
unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
kbecker42 committed May 17, 2024
1 parent b6bbc44 commit e7c5617
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion test/test_locked_sched.py
Original file line number Diff line number Diff line change
Expand Up @@ -298,14 +298,17 @@ def test_get_task_id_and_duration_for_project_user_missing(self):

@with_context
@patch('pybossa.sched.task_repo.get_task')
def get_task_id_and_duration_for_project_user_invalid_task_id(self, get_task):
def test_get_task_id_and_duration_for_project_user_invalid_task_id(self, get_task):
user = UserFactory.create()
project = ProjectFactory.create(owner=user, short_name='egil', name='egil',
description='egil')
task = TaskFactory.create_batch(1, project=project, n_answers=1)[0]
limit = 1
timeout = 100
acquire_locks(task.id, user.id, limit, timeout)

# Simulate invalid task.
get_task.return_value = None
task_id, seconds = get_task_id_and_duration_for_project_user(project.id, user.id)

assert task_id is None
Expand Down

0 comments on commit e7c5617

Please sign in to comment.