Skip to content

Commit

Permalink
format robot-server tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sfoster1 committed Dec 20, 2023
1 parent 86b2ba4 commit 76b2244
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ async def test_runs_completed_filled_started_at_none_persist(
get_run_response = await client.get_run(run_id=run_id)
run_data = get_run_response.json()["data"]

assert run_data['startedAt'] is None
assert run_data["startedAt"] is None
assert datetime.fromisoformat(run_data["completedAt"]).timestamp() == pytest.approx(
expected_completed_at.timestamp(), abs=2
)
2 changes: 1 addition & 1 deletion robot-server/tests/protocols/test_analysis_store.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ async def test_update_adds_details_and_completes_analysis(
"definitionUri": "namespace/load-name/42",
"location": {"slotName": "1"},
"displayName": None,
"offsetId": None
"offsetId": None,
}
],
"pipettes": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,11 @@
JsonProtocolConfig,
)
from robot_server.protocols.analysis_memcache import MemoryCache
from robot_server.protocols.analysis_models import CompletedAnalysis, AnalysisResult, AnalysisStatus
from robot_server.protocols.analysis_models import (
CompletedAnalysis,
AnalysisResult,
AnalysisStatus,
)
from robot_server.protocols.protocol_store import (
ProtocolStore,
ProtocolResource,
Expand Down
20 changes: 15 additions & 5 deletions robot-server/tests/service/legacy/routers/test_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,9 @@ def mock_pipette_data():
def mock_known_pipettes(decoy: Decoy) -> Decoy:
with patch(
"opentrons_shared_data.pipette.mutable_configurations.known_pipettes",
new=decoy.mock(name="opentrons_shared_data.pipette.mutable_configurations.known_pipettes"),
new=decoy.mock(
name="opentrons_shared_data.pipette.mutable_configurations.known_pipettes"
),
) as m:
yield m

Expand All @@ -128,7 +130,9 @@ def mock_known_pipettes(decoy: Decoy) -> Decoy:
def mock_list_mutable_configs(decoy: Decoy) -> Decoy:
with patch(
"opentrons_shared_data.pipette.mutable_configurations.list_mutable_configs",
new=decoy.mock(name="opentrons_shared_data.pipette.mutable_configurations.list_mutable_configs"),
new=decoy.mock(
name="opentrons_shared_data.pipette.mutable_configurations.list_mutable_configs"
),
) as m:
yield m

Expand All @@ -137,7 +141,9 @@ def mock_list_mutable_configs(decoy: Decoy) -> Decoy:
def mock_list_mutable_configs_with_defaults(decoy: Decoy) -> Decoy:
with patch(
"opentrons_shared_data.pipette.mutable_configurations.list_mutable_configs_with_defaults",
new=decoy.mock(name="opentrons_shared_data.pipette.mutable_configurations.list_mutable_configs_with_defaults"),
new=decoy.mock(
name="opentrons_shared_data.pipette.mutable_configurations.list_mutable_configs_with_defaults"
),
) as m:
yield m

Expand All @@ -146,7 +152,9 @@ def mock_list_mutable_configs_with_defaults(decoy: Decoy) -> Decoy:
def mock_save_overrides(decoy: Decoy) -> Decoy:
with patch(
"opentrons_shared_data.pipette.mutable_configurations.save_overrides",
new=decoy.mock(name="opentrons_shared_data.pipette.mutable_configurations.save_overrides"),
new=decoy.mock(
name="opentrons_shared_data.pipette.mutable_configurations.save_overrides"
),
) as m:
yield m

Expand All @@ -155,7 +163,9 @@ def mock_save_overrides(decoy: Decoy) -> Decoy:
def mock_get_opentrons_dir(decoy: Decoy) -> Decoy:
with patch(
"robot_server.service.legacy.routers.settings.get_opentrons_path",
new=decoy.mock(name="robot_server.service.legacy.routers.settings.get_opentrons_path"),
new=decoy.mock(
name="robot_server.service.legacy.routers.settings.get_opentrons_path"
),
) as m:
yield m

Expand Down

0 comments on commit 76b2244

Please sign in to comment.