@@ -991,10 +991,10 @@ async def test_query_data_generic_fragment(clients, mock_schema_query_02, client
991991async def test_query_data_include_property (client , location_schema : NodeSchemaAPI , client_type ):
992992 if client_type == "standard" :
993993 node = InfrahubNode (client = client , schema = location_schema )
994- data = await node .generate_query_data (include = ["tags" ], property = True )
994+ data = await node .generate_query_data (include = ["name" , "type" , " tags" ], property = True )
995995 else :
996996 node = InfrahubNodeSync (client = client , schema = location_schema )
997- data = node .generate_query_data (include = ["tags" ], property = True )
997+ data = node .generate_query_data (include = ["name" , "type" , " tags" ], property = True )
998998
999999 assert data == {
10001000 "BuiltinLocation" : {
@@ -1023,23 +1023,6 @@ async def test_query_data_include_property(client, location_schema: NodeSchemaAP
10231023 },
10241024 "value" : None ,
10251025 },
1026- "description" : {
1027- "is_default" : None ,
1028- "is_from_profile" : None ,
1029- "is_protected" : None ,
1030- "is_visible" : None ,
1031- "owner" : {
1032- "__typename" : None ,
1033- "display_label" : None ,
1034- "id" : None ,
1035- },
1036- "source" : {
1037- "__typename" : None ,
1038- "display_label" : None ,
1039- "id" : None ,
1040- },
1041- "value" : None ,
1042- },
10431026 "type" : {
10441027 "is_default" : None ,
10451028 "is_from_profile" : None ,
@@ -1057,28 +1040,6 @@ async def test_query_data_include_property(client, location_schema: NodeSchemaAP
10571040 },
10581041 "value" : None ,
10591042 },
1060- "primary_tag" : {
1061- "properties" : {
1062- "is_protected" : None ,
1063- "is_visible" : None ,
1064- "owner" : {
1065- "__typename" : None ,
1066- "display_label" : None ,
1067- "id" : None ,
1068- },
1069- "source" : {
1070- "__typename" : None ,
1071- "display_label" : None ,
1072- "id" : None ,
1073- },
1074- },
1075- "node" : {
1076- "id" : None ,
1077- "hfid" : None ,
1078- "display_label" : None ,
1079- "__typename" : None ,
1080- },
1081- },
10821043 "tags" : {
10831044 "count" : None ,
10841045 "edges" : {
@@ -1113,10 +1074,10 @@ async def test_query_data_include_property(client, location_schema: NodeSchemaAP
11131074async def test_query_data_include (client , location_schema : NodeSchemaAPI , client_type ):
11141075 if client_type == "standard" :
11151076 node = InfrahubNode (client = client , schema = location_schema )
1116- data = await node .generate_query_data (include = ["tags" ])
1077+ data = await node .generate_query_data (include = ["name" , "type" , " tags" ])
11171078 else :
11181079 node = InfrahubNodeSync (client = client , schema = location_schema )
1119- data = node .generate_query_data (include = ["tags" ])
1080+ data = node .generate_query_data (include = ["name" , "type" , " tags" ])
11201081
11211082 assert data == {
11221083 "BuiltinLocation" : {
@@ -1131,20 +1092,9 @@ async def test_query_data_include(client, location_schema: NodeSchemaAPI, client
11311092 "name" : {
11321093 "value" : None ,
11331094 },
1134- "description" : {
1135- "value" : None ,
1136- },
11371095 "type" : {
11381096 "value" : None ,
11391097 },
1140- "primary_tag" : {
1141- "node" : {
1142- "id" : None ,
1143- "hfid" : None ,
1144- "display_label" : None ,
1145- "__typename" : None ,
1146- },
1147- },
11481098 "tags" : {
11491099 "count" : None ,
11501100 "edges" : {
@@ -1251,6 +1201,21 @@ async def test_query_data_exclude(client, location_schema: NodeSchemaAPI, client
12511201 }
12521202
12531203
1204+ @pytest .mark .parametrize ("client_type" , client_types )
1205+ async def test_query_data_include_exclude (client , location_schema : NodeSchemaAPI , client_type ):
1206+ if client_type == "standard" :
1207+ node = InfrahubNode (client = client , schema = location_schema )
1208+
1209+ with pytest .raises (ValueError ) as exc :
1210+ await node .generate_query_data (include = ["name" , "type" ], exclude = ["description" ], property = True )
1211+ assert "include and exclude are exclusive" in str (exc .value )
1212+ else :
1213+ node = InfrahubNodeSync (client = client , schema = location_schema )
1214+ with pytest .raises (ValueError ) as exc :
1215+ node .generate_query_data (include = ["name" , "type" , "tags" ], exclude = ["description" ], property = True )
1216+ assert "include and exclude are exclusive" in str (exc .value )
1217+
1218+
12541219@pytest .mark .parametrize ("client_type" , client_types )
12551220async def test_create_input_data (client , location_schema : NodeSchemaAPI , client_type ):
12561221 data = {"name" : {"value" : "JFK1" }, "description" : {"value" : "JFK Airport" }, "type" : {"value" : "SITE" }}
0 commit comments