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

commented out call to run_store.has() #10340

Merged
merged 2 commits into from
May 18, 2022
Merged
Show file tree
Hide file tree
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
8 changes: 4 additions & 4 deletions robot-server/robot_server/runs/router/commands_router.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,10 @@ async def get_current_run_engine_from_url(
engine_store: Engine store to pull current run ProtocolEngine.
run_store: Run data storage.
"""
if not run_store.has(runId):
raise RunNotFound(detail=f"Run {runId} not found.").as_error(
status.HTTP_404_NOT_FOUND
)
# if not run_store.has(runId):
# raise RunNotFound(detail=f"Run {runId} not found.").as_error(
# status.HTTP_404_NOT_FOUND
# )

if runId != engine_store.current_run_id:
raise RunStopped(detail=f"Run {runId} is not the current run").as_error(
Expand Down
34 changes: 17 additions & 17 deletions robot-server/tests/runs/router/test_commands_router.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,23 +51,23 @@ async def test_get_current_run_engine_from_url(
assert result is mock_engine_store.engine


async def test_get_current_run_engine_no_run(
decoy: Decoy,
mock_engine_store: EngineStore,
mock_run_store: RunStore,
) -> None:
"""It should 404 if the run is not in the store."""
decoy.when(mock_run_store.has("run-id")).then_return(False)

with pytest.raises(ApiError) as exc_info:
await get_current_run_engine_from_url(
runId="run-id",
engine_store=mock_engine_store,
run_store=mock_run_store,
)

assert exc_info.value.status_code == 404
assert exc_info.value.content["errors"][0]["id"] == "RunNotFound"
# async def test_get_current_run_engine_no_run(
# decoy: Decoy,
# mock_engine_store: EngineStore,
# mock_run_store: RunStore,
# ) -> None:
# """It should 404 if the run is not in the store."""
# decoy.when(mock_run_store.has("run-id")).then_return(False)
#
# with pytest.raises(ApiError) as exc_info:
# await get_current_run_engine_from_url(
# runId="run-id",
# engine_store=mock_engine_store,
# run_store=mock_run_store,
# )
#
# assert exc_info.value.status_code == 404
# assert exc_info.value.content["errors"][0]["id"] == "RunNotFound"


async def test_get_current_run_engine_from_url_not_current(
Expand Down