Skip to content

Commit

Permalink
Convert REST API tests into true unit tests
Browse files Browse the repository at this point in the history
Mock runner, test REST calls only
  • Loading branch information
callumforrester committed Nov 29, 2024
1 parent ce35c84 commit 126c5cd
Show file tree
Hide file tree
Showing 2 changed files with 109 additions and 161 deletions.
7 changes: 5 additions & 2 deletions src/blueapi/service/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,12 @@ def _runner() -> WorkerDispatcher:
return RUNNER


def setup_runner(config: ApplicationConfig | None = None, use_subprocess: bool = True):
def setup_runner(
config: ApplicationConfig | None = None,
runner: WorkerDispatcher | None = None,
):
global RUNNER
runner = WorkerDispatcher(config, use_subprocess)
runner = runner or WorkerDispatcher(config)
runner.start()

RUNNER = runner
Expand Down
Loading

0 comments on commit 126c5cd

Please sign in to comment.