Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option to mock specific values in presets. #94

Merged
merged 4 commits into from
Sep 12, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions ev3sim/single_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import time
from ev3sim.file_helper import find_abs
import yaml
from unittest import mock
from ev3sim.simulation.loader import runFromConfig


Expand Down Expand Up @@ -38,6 +39,11 @@ def run(shared_data, result):
return
result.put(True)

# Handle any other settings modified by the preset.
settings = config.get("settings", {})
for keyword, value in settings.items():
run = mock.patch(keyword, value)(run)

comm_thread = Thread(
target=start_server_with_shared_data, args=(shared_data, result_bucket, bind_addr), daemon=True
)
Expand Down