Skip to content

Commit 4116a2a

Browse files
style: auto-format code with ruff [skip ci]
1 parent ccc0205 commit 4116a2a

2 files changed

Lines changed: 8 additions & 19 deletions

File tree

tests/integration/api/test_scheduler_header.py

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -184,9 +184,7 @@ def app_with_real_routes(self):
184184

185185
return app
186186

187-
def test_x_orb_scheduler_header_present_in_request_reaches_server(
188-
self, app_with_real_routes
189-
):
187+
def test_x_orb_scheduler_header_present_in_request_reaches_server(self, app_with_real_routes):
190188
"""A request with X-ORB-Scheduler header is accepted (not rejected by middleware)."""
191189
from fastapi.testclient import TestClient
192190

@@ -206,18 +204,11 @@ def test_routes_use_get_response_formatting_service_not_get_request_formatter(se
206204
"""
207205
import ast
208206

209-
routers_dir = (
210-
Path(__file__).parent.parent.parent
211-
/ "src" / "orb" / "api" / "routers"
212-
)
207+
routers_dir = Path(__file__).parent.parent.parent / "src" / "orb" / "api" / "routers"
213208
for router_file in routers_dir.glob("*.py"):
214209
source = router_file.read_text()
215210
tree = ast.parse(source)
216-
names_used = {
217-
node.id
218-
for node in ast.walk(tree)
219-
if isinstance(node, ast.Name)
220-
}
211+
names_used = {node.id for node in ast.walk(tree) if isinstance(node, ast.Name)}
221212
# Current state: routers use get_response_formatting_service
222213
if "get_response_formatting_service" in source:
223214
assert "get_response_formatting_service" in names_used, (
@@ -249,7 +240,9 @@ def test_format_request_operation_uses_injected_scheduler(self):
249240
scheduler = _make_mock_scheduler("hf")
250241
svc = ResponseFormattingService(scheduler)
251242

252-
result = svc.format_request_operation({"request_id": "req-1", "status": "pending"}, "pending")
243+
result = svc.format_request_operation(
244+
{"request_id": "req-1", "status": "pending"}, "pending"
245+
)
253246

254247
scheduler.format_request_response.assert_called_once()
255248
assert result.data.get("scheduler") == "hf"

tests/onmoto/test_client_template_format.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -224,9 +224,7 @@ def test_aws_template_image_id_not_required_when_launch_template_id_set(
224224
assert template.image_id is None
225225
assert template.launch_template_id == "lt-12345678abcdef012"
226226

227-
def test_aws_template_provider_api_defaults_to_ec2fleet_when_absent(
228-
self, moto_vpc_resources
229-
):
227+
def test_aws_template_provider_api_defaults_to_ec2fleet_when_absent(self, moto_vpc_resources):
230228
"""When provider_api is None, the template still constructs; EC2Fleet is the expected default."""
231229
subnet_id = moto_vpc_resources["subnet_ids"][0]
232230
sg_id = moto_vpc_resources["sg_id"]
@@ -427,9 +425,7 @@ def test_ec2fleet_spot_acquire_with_launch_template_id(
427425
resp = ec2_client.describe_fleets(FleetIds=[fleet_id])
428426
assert len(resp["Fleets"]) == 1
429427

430-
def test_ec2fleet_spot_provider_data_resource_type(
431-
self, aws_client, moto_vpc_resources
432-
):
428+
def test_ec2fleet_spot_provider_data_resource_type(self, aws_client, moto_vpc_resources):
433429
"""provider_data identifies resource as ec2_fleet for launch_template_id template."""
434430
from orb.providers.aws.infrastructure.handlers.ec2_fleet.handler import EC2FleetHandler
435431
from orb.providers.aws.utilities.aws_operations import AWSOperations

0 commit comments

Comments
 (0)