Skip to content

Commit dd24d0f

Browse files
Copilotminitriga
andcommitted
Add type annotations to test parameters and use BothClients fixture
- Added BothClients import to TYPE_CHECKING block - Updated test_update_input_data_existing_node_with_optional_relationship to use clients fixture with proper type annotations - Changed from client fixture to clients fixture (clients.standard and clients.sync) - Added type annotation for client_type parameter Co-authored-by: minitriga <[email protected]>
1 parent f0ee3cd commit dd24d0f

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

tests/unit/sdk/test_node.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121
if TYPE_CHECKING:
2222
from infrahub_sdk.client import InfrahubClient, InfrahubClientSync
2323

24+
from .conftest import BothClients
25+
2426
# type: ignore[attr-defined]
2527

2628
async_node_methods = [
@@ -1398,7 +1400,7 @@ async def test_create_input_data_with_dropdown(client, location_schema_with_drop
13981400

13991401
@pytest.mark.parametrize("client_type", client_types)
14001402
async def test_update_input_data_existing_node_with_optional_relationship(
1401-
client, location_schema: NodeSchemaAPI, client_type
1403+
clients: "BothClients", location_schema: NodeSchemaAPI, client_type: str
14021404
) -> None:
14031405
"""Validate that existing nodes include None for uninitialized optional relationships.
14041406
@@ -1413,9 +1415,9 @@ async def test_update_input_data_existing_node_with_optional_relationship(
14131415
}
14141416

14151417
if client_type == "standard":
1416-
node = InfrahubNode(client=client, schema=location_schema, data=data)
1418+
node = InfrahubNode(client=clients.standard, schema=location_schema, data=data)
14171419
else:
1418-
node = InfrahubNodeSync(client=client, schema=location_schema, data=data)
1420+
node = InfrahubNodeSync(client=clients.sync, schema=location_schema, data=data)
14191421

14201422
# For existing nodes, optional uninitialized relationships should include None
14211423
assert node._generate_input_data()["data"] == {

0 commit comments

Comments
 (0)