16 lines
612 B
Python
16 lines
612 B
Python
from dx_productivity.dsh.actions import ActionProposal
|
|
from dx_productivity.dsh.service_adapter import DshServiceAdapter
|
|
|
|
|
|
class FakeService:
|
|
def __init__(self): self.calls = []
|
|
def prepare_failed_quick_run(self, task_id): self.calls.append(("retry", task_id))
|
|
def pause_task(self, task_id): self.calls.append(("pause", task_id))
|
|
|
|
|
|
def test_adapter_exposes_only_fixed_service_operations():
|
|
service = FakeService()
|
|
result = DshServiceAdapter(service).execute(ActionProposal("retry_failed", "task-1"))
|
|
assert result["status"] == "accepted"
|
|
assert service.calls == [("retry", "task-1")]
|