Skip to content

Commit

Permalink
unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
Andy-JB authored and JonatanMartens committed Jul 5, 2022
1 parent d29895d commit c106eff
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tests/unit/task/task_builder_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import pytest

from pyzeebe import Job, TaskDecorator
from pyzeebe.job.job_status import JobStatus
from pyzeebe.task import task_builder
from pyzeebe.task.task import Task
from pyzeebe.task.task_config import TaskConfig
Expand Down Expand Up @@ -198,6 +199,17 @@ async def test_decorator_variables_are_added(

assert "x" in job.variables

@pytest.mark.asyncio
async def test_job_status_is_updated(
self,
task_config: TaskConfig,
mocked_job_with_adapter: Job,
):
job_handler = task_builder.build_job_handler(self.function_with_job_parameter, task_config)
job = await job_handler(mocked_job_with_adapter)

assert job.status == JobStatus.RunningAfterDecorators

@pytest.mark.asyncio
async def test_job_parameter_is_injected(self, task_config: TaskConfig, mocked_job_with_adapter: Job):
task_config.job_parameter_name = "job"
Expand Down

0 comments on commit c106eff

Please sign in to comment.