@@ -991,10 +991,10 @@ async def test_query_data_generic_fragment(clients, mock_schema_query_02, client
991
991
async def test_query_data_include_property (client , location_schema : NodeSchemaAPI , client_type ):
992
992
if client_type == "standard" :
993
993
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 )
995
995
else :
996
996
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 )
998
998
999
999
assert data == {
1000
1000
"BuiltinLocation" : {
@@ -1023,23 +1023,6 @@ async def test_query_data_include_property(client, location_schema: NodeSchemaAP
1023
1023
},
1024
1024
"value" : None ,
1025
1025
},
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
- },
1043
1026
"type" : {
1044
1027
"is_default" : None ,
1045
1028
"is_from_profile" : None ,
@@ -1057,28 +1040,6 @@ async def test_query_data_include_property(client, location_schema: NodeSchemaAP
1057
1040
},
1058
1041
"value" : None ,
1059
1042
},
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
- },
1082
1043
"tags" : {
1083
1044
"count" : None ,
1084
1045
"edges" : {
@@ -1113,10 +1074,10 @@ async def test_query_data_include_property(client, location_schema: NodeSchemaAP
1113
1074
async def test_query_data_include (client , location_schema : NodeSchemaAPI , client_type ):
1114
1075
if client_type == "standard" :
1115
1076
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" ])
1117
1078
else :
1118
1079
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" ])
1120
1081
1121
1082
assert data == {
1122
1083
"BuiltinLocation" : {
@@ -1131,20 +1092,9 @@ async def test_query_data_include(client, location_schema: NodeSchemaAPI, client
1131
1092
"name" : {
1132
1093
"value" : None ,
1133
1094
},
1134
- "description" : {
1135
- "value" : None ,
1136
- },
1137
1095
"type" : {
1138
1096
"value" : None ,
1139
1097
},
1140
- "primary_tag" : {
1141
- "node" : {
1142
- "id" : None ,
1143
- "hfid" : None ,
1144
- "display_label" : None ,
1145
- "__typename" : None ,
1146
- },
1147
- },
1148
1098
"tags" : {
1149
1099
"count" : None ,
1150
1100
"edges" : {
@@ -1251,6 +1201,21 @@ async def test_query_data_exclude(client, location_schema: NodeSchemaAPI, client
1251
1201
}
1252
1202
1253
1203
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
+
1254
1219
@pytest .mark .parametrize ("client_type" , client_types )
1255
1220
async def test_create_input_data (client , location_schema : NodeSchemaAPI , client_type ):
1256
1221
data = {"name" : {"value" : "JFK1" }, "description" : {"value" : "JFK Airport" }, "type" : {"value" : "SITE" }}
0 commit comments