Skip to content

Commit 1de6ece

Browse files
Add missing keyword arguments to integration tests
1 parent a877a2b commit 1de6ece

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

integration_tests/test_api.py

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ async def test_create_and_get_order(set_up: dict[str, Any]) -> None:
150150

151151
# Fetch order to check it exists remotely
152152
fetched_order = await set_up["client"].get_gridpool_order(
153-
GRIDPOOL_ID, order.order_id
153+
GRIDPOOL_ID, order_id=order.order_id
154154
)
155155

156156
assert fetched_order.order == order.order, "Order mismatch"
@@ -246,7 +246,7 @@ async def test_update_order_price(set_up: dict[str, Any]) -> None:
246246

247247
assert updated_order.order.price.amount == new_price.amount, "Price update failed"
248248
fetched_order = await set_up["client"].get_gridpool_order(
249-
GRIDPOOL_ID, order.order_id
249+
GRIDPOOL_ID, order_id=order.order_id
250250
)
251251
assert (
252252
fetched_order.order.price.amount == updated_order.order.price.amount
@@ -282,12 +282,12 @@ async def test_cancel_order(set_up: dict[str, Any]) -> None:
282282

283283
# Cancel the created order and ensure it's cancelled
284284
cancelled_order = await set_up["client"].cancel_gridpool_order(
285-
GRIDPOOL_ID, order.order_id
285+
GRIDPOOL_ID, order_id=order.order_id
286286
)
287287
assert cancelled_order.order_id == order.order_id, "Order cancellation failed"
288288

289289
fetched_order = await set_up["client"].get_gridpool_order(
290-
GRIDPOOL_ID, order.order_id
290+
GRIDPOOL_ID, order_id=order.order_id
291291
)
292292
assert (
293293
fetched_order.state_detail.state == OrderState.CANCELED
@@ -300,7 +300,7 @@ async def test_update_cancelled_order_failure(set_up: dict[str, Any]) -> None:
300300
order = await create_test_order(set_up)
301301

302302
# Cancel the created order
303-
await set_up["client"].cancel_gridpool_order(GRIDPOOL_ID, order.order_id)
303+
await set_up["client"].cancel_gridpool_order(GRIDPOOL_ID, order_id=order.order_id)
304304

305305
# Expected failure as cancelled order cannot be updated
306306
with pytest.raises(grpc.aio.AioRpcError) as excinfo:
@@ -448,7 +448,9 @@ async def test_cancel_non_existent_order(set_up: dict[str, Any]) -> None:
448448
"""Test canceling a non-existent order and expecting an error."""
449449
non_existent_order_id = 999999
450450
with pytest.raises(grpc.aio.AioRpcError) as excinfo:
451-
await set_up["client"].cancel_gridpool_order(GRIDPOOL_ID, non_existent_order_id)
451+
await set_up["client"].cancel_gridpool_order(
452+
GRIDPOOL_ID, order_id=non_existent_order_id
453+
)
452454
assert (
453455
excinfo.value.code() == grpc.StatusCode.UNAVAILABLE
454456
), "Cancelling non-existent order should return an error"
@@ -457,10 +459,10 @@ async def test_cancel_non_existent_order(set_up: dict[str, Any]) -> None:
457459
async def test_cancel_already_cancelled_order(set_up: dict[str, Any]) -> None:
458460
"""Test cancelling an order twice to ensure idempotent behavior."""
459461
order = await create_test_order(set_up)
460-
await set_up["client"].cancel_gridpool_order(GRIDPOOL_ID, order.order_id)
462+
await set_up["client"].cancel_gridpool_order(GRIDPOOL_ID, order_id=order.order_id)
461463
with pytest.raises(grpc.aio.AioRpcError) as excinfo:
462464
cancelled_order = await set_up["client"].cancel_gridpool_order(
463-
GRIDPOOL_ID, order.order_id
465+
GRIDPOOL_ID, order_id=order.order_id
464466
)
465467
assert (
466468
excinfo.value.code() == grpc.StatusCode.INVALID_ARGUMENT
@@ -548,7 +550,7 @@ async def test_concurrent_cancel_and_update_order(set_up: dict[str, Any]) -> Non
548550
new_price = Price(amount=Decimal("50"), currency=Currency.EUR)
549551

550552
cancelled_order = await set_up["client"].cancel_gridpool_order(
551-
GRIDPOOL_ID, order.order_id
553+
GRIDPOOL_ID, order_id=order.order_id
552554
)
553555

554556
with pytest.raises(grpc.aio.AioRpcError) as excinfo:

0 commit comments

Comments
 (0)