Coverage for app/domain/services/CommandRunner.py: 100%
12 statements
« prev ^ index » next coverage.py v7.14.1, created at 2026-06-16 20:06 +0000
« prev ^ index » next coverage.py v7.14.1, created at 2026-06-16 20:06 +0000
1from app.domain.probe.commands.factory import CommandFactory
2from app.domain.probe.entities.grid import Grid
3from app.domain.probe.entities.probe import Probe
6class CommandRunner:
7 def __init__(self, grid: Grid):
8 self.grid = grid
10 def run(self, probe: Probe, commands: str) -> Probe:
11 new_probe = Probe(x=probe.x, y=probe.y, direction=probe.direction)
13 for command_str in commands:
14 command = CommandFactory.create(command_str)
15 new_probe = command.execute(new_probe, self.grid)
17 return new_probe