@@ -981,10 +981,10 @@ async def test_query_data_generic_fragment(clients, mock_schema_query_02, client
981981async def test_query_data_include_property (client , location_schema : NodeSchemaAPI , client_type ):
982982 if client_type == "standard" :
983983 node = InfrahubNode (client = client , schema = location_schema )
984- data = await node .generate_query_data (include = ["tags" ], property = True )
984+ data = await node .generate_query_data (include = ["name" , "type" , " tags" ], property = True )
985985 else :
986986 node = InfrahubNodeSync (client = client , schema = location_schema )
987- data = node .generate_query_data (include = ["tags" ], property = True )
987+ data = node .generate_query_data (include = ["name" , "type" , " tags" ], property = True )
988988
989989 assert data == {
990990 "BuiltinLocation" : {
@@ -1013,23 +1013,6 @@ async def test_query_data_include_property(client, location_schema: NodeSchemaAP
10131013 },
10141014 "value" : None ,
10151015 },
1016- "description" : {
1017- "is_default" : None ,
1018- "is_from_profile" : None ,
1019- "is_protected" : None ,
1020- "is_visible" : None ,
1021- "owner" : {
1022- "__typename" : None ,
1023- "display_label" : None ,
1024- "id" : None ,
1025- },
1026- "source" : {
1027- "__typename" : None ,
1028- "display_label" : None ,
1029- "id" : None ,
1030- },
1031- "value" : None ,
1032- },
10331016 "type" : {
10341017 "is_default" : None ,
10351018 "is_from_profile" : None ,
@@ -1047,28 +1030,6 @@ async def test_query_data_include_property(client, location_schema: NodeSchemaAP
10471030 },
10481031 "value" : None ,
10491032 },
1050- "primary_tag" : {
1051- "properties" : {
1052- "is_protected" : None ,
1053- "is_visible" : None ,
1054- "owner" : {
1055- "__typename" : None ,
1056- "display_label" : None ,
1057- "id" : None ,
1058- },
1059- "source" : {
1060- "__typename" : None ,
1061- "display_label" : None ,
1062- "id" : None ,
1063- },
1064- },
1065- "node" : {
1066- "id" : None ,
1067- "hfid" : None ,
1068- "display_label" : None ,
1069- "__typename" : None ,
1070- },
1071- },
10721033 "tags" : {
10731034 "count" : None ,
10741035 "edges" : {
@@ -1103,10 +1064,10 @@ async def test_query_data_include_property(client, location_schema: NodeSchemaAP
11031064async def test_query_data_include (client , location_schema : NodeSchemaAPI , client_type ):
11041065 if client_type == "standard" :
11051066 node = InfrahubNode (client = client , schema = location_schema )
1106- data = await node .generate_query_data (include = ["tags" ])
1067+ data = await node .generate_query_data (include = ["name" , "type" , " tags" ])
11071068 else :
11081069 node = InfrahubNodeSync (client = client , schema = location_schema )
1109- data = node .generate_query_data (include = ["tags" ])
1070+ data = node .generate_query_data (include = ["name" , "type" , " tags" ])
11101071
11111072 assert data == {
11121073 "BuiltinLocation" : {
@@ -1121,20 +1082,9 @@ async def test_query_data_include(client, location_schema: NodeSchemaAPI, client
11211082 "name" : {
11221083 "value" : None ,
11231084 },
1124- "description" : {
1125- "value" : None ,
1126- },
11271085 "type" : {
11281086 "value" : None ,
11291087 },
1130- "primary_tag" : {
1131- "node" : {
1132- "id" : None ,
1133- "hfid" : None ,
1134- "display_label" : None ,
1135- "__typename" : None ,
1136- },
1137- },
11381088 "tags" : {
11391089 "count" : None ,
11401090 "edges" : {
@@ -1241,6 +1191,21 @@ async def test_query_data_exclude(client, location_schema: NodeSchemaAPI, client
12411191 }
12421192
12431193
1194+ @pytest .mark .parametrize ("client_type" , client_types )
1195+ async def test_query_data_include_exclude (client , location_schema : NodeSchemaAPI , client_type ):
1196+ if client_type == "standard" :
1197+ node = InfrahubNode (client = client , schema = location_schema )
1198+
1199+ with pytest .raises (ValueError ) as exc :
1200+ await node .generate_query_data (include = ["name" , "type" ], exclude = ["description" ], property = True )
1201+ assert "include and exclude are exclusive" in str (exc .value )
1202+ else :
1203+ node = InfrahubNodeSync (client = client , schema = location_schema )
1204+ with pytest .raises (ValueError ) as exc :
1205+ node .generate_query_data (include = ["name" , "type" , "tags" ], exclude = ["description" ], property = True )
1206+ assert "include and exclude are exclusive" in str (exc .value )
1207+
1208+
12441209@pytest .mark .parametrize ("client_type" , client_types )
12451210async def test_create_input_data (client , location_schema : NodeSchemaAPI , client_type ):
12461211 data = {"name" : {"value" : "JFK1" }, "description" : {"value" : "JFK Airport" }, "type" : {"value" : "SITE" }}
0 commit comments