@@ -29,13 +29,15 @@ def sample_config_list_response() -> dict[str, Any]:
2929 {
3030 "id" : CONFIG_ID_1 ,
3131 "name" : "my_config" ,
32+ "config_type" : "database" ,
3233 "archived" : False ,
3334 "created" : "2025-01-01T12:00:00Z" ,
3435 "modified" : "2025-01-02T12:00:00Z" ,
3536 },
3637 {
3738 "id" : CONFIG_ID_2 ,
3839 "name" : "another_config" ,
40+ "config_type" : "database" ,
3941 "archived" : False ,
4042 "created" : "2025-02-01T12:00:00Z" ,
4143 "modified" : "2025-02-02T12:00:00Z" ,
@@ -50,6 +52,7 @@ def sample_config_detail_response() -> dict[str, Any]:
5052 "id" : CONFIG_ID_1 ,
5153 "name" : "my_config" ,
5254 "config_yaml" : "labels: []\n metadata_rules: []\n idd_rules: []\n " ,
55+ "config_type" : "database" ,
5356 "archived" : False ,
5457 "created" : "2025-01-01T12:00:00Z" ,
5558 "modified" : "2025-01-02T12:00:00Z" ,
@@ -61,6 +64,7 @@ def discovery_config() -> DiscoveryConfig:
6164 return DiscoveryConfig (
6265 name = "test_config" ,
6366 yaml = "labels: []\n metadata_rules: []\n idd_rules: []\n " ,
67+ config_type = "database" ,
6468 )
6569
6670
@@ -89,13 +93,15 @@ def test_list_discovery_configs_pagination(client: DataMasqueClient) -> None:
8993 {
9094 "id" : CONFIG_ID_1 ,
9195 "name" : "c1" ,
96+ "config_type" : "database" ,
9297 "archived" : False ,
9398 "created" : "2025-01-01T12:00:00Z" ,
9499 "modified" : "2025-01-01T12:00:00Z" ,
95100 },
96101 {
97102 "id" : CONFIG_ID_2 ,
98103 "name" : "c2" ,
104+ "config_type" : "database" ,
99105 "archived" : False ,
100106 "created" : "2025-01-01T12:00:00Z" ,
101107 "modified" : "2025-01-01T12:00:00Z" ,
@@ -110,6 +116,7 @@ def test_list_discovery_configs_pagination(client: DataMasqueClient) -> None:
110116 {
111117 "id" : "cccccccc-1111-2222-3333-444444444444" ,
112118 "name" : "c3" ,
119+ "config_type" : "database" ,
113120 "archived" : False ,
114121 "created" : "2025-01-01T12:00:00Z" ,
115122 "modified" : "2025-01-01T12:00:00Z" ,
@@ -162,6 +169,7 @@ def test_get_discovery_config_by_name_found(
162169 {
163170 "id" : CONFIG_ID_1 ,
164171 "name" : "my_config" ,
172+ "config_type" : "database" ,
165173 "archived" : False ,
166174 "created" : "2025-01-01T12:00:00Z" ,
167175 "modified" : "2025-01-02T12:00:00Z" ,
@@ -209,6 +217,7 @@ def test_get_discovery_config_by_name_raises_when_server_omits_id(client: DataMa
209217 "results" : [
210218 {
211219 "name" : "my_config" ,
220+ "config_type" : "database" ,
212221 "archived" : False ,
213222 "created" : "2025-01-01T12:00:00Z" ,
214223 "modified" : "2025-01-02T12:00:00Z" ,
@@ -231,6 +240,7 @@ def test_create_discovery_config(client: DataMasqueClient, discovery_config: Dis
231240 "id" : CONFIG_ID_1 ,
232241 "name" : "test_config" ,
233242 "config_yaml" : "labels: []\n metadata_rules: []\n idd_rules: []\n " ,
243+ "config_type" : "database" ,
234244 "archived" : False ,
235245 "created" : "2025-06-01T10:00:00Z" ,
236246 "modified" : "2025-06-01T10:00:00Z" ,
@@ -252,6 +262,7 @@ def test_create_discovery_config(client: DataMasqueClient, discovery_config: Dis
252262 request_body = m .last_request .json ()
253263 assert request_body ["name" ] == "test_config"
254264 assert request_body ["config_yaml" ] == "labels: []\n metadata_rules: []\n idd_rules: []\n "
265+ assert request_body ["config_type" ] == "database"
255266
256267
257268def test_update_discovery_config (client : DataMasqueClient , discovery_config : DiscoveryConfig ) -> None :
@@ -261,6 +272,7 @@ def test_update_discovery_config(client: DataMasqueClient, discovery_config: Dis
261272 "id" : CONFIG_ID_1 ,
262273 "name" : "test_config" ,
263274 "config_yaml" : "labels: []\n metadata_rules: []\n idd_rules: []\n " ,
275+ "config_type" : "database" ,
264276 "archived" : False ,
265277 "created" : "2025-06-01T10:00:00Z" ,
266278 "modified" : "2025-06-02T10:00:00Z" ,
@@ -293,6 +305,7 @@ def test_create_or_update_discovery_config_create(client: DataMasqueClient, disc
293305 "id" : CONFIG_ID_1 ,
294306 "name" : "test_config" ,
295307 "config_yaml" : "labels: []\n metadata_rules: []\n idd_rules: []\n " ,
308+ "config_type" : "database" ,
296309 "archived" : False ,
297310 "created" : "2025-06-01T10:00:00Z" ,
298311 "modified" : "2025-06-01T10:00:00Z" ,
@@ -317,6 +330,7 @@ def test_create_or_update_discovery_config_update(client: DataMasqueClient, disc
317330 {
318331 "id" : CONFIG_ID_1 ,
319332 "name" : "test_config" ,
333+ "config_type" : "database" ,
320334 "archived" : False ,
321335 "created" : "2025-06-01T10:00:00Z" ,
322336 "modified" : "2025-06-01T10:00:00Z" ,
@@ -327,6 +341,7 @@ def test_create_or_update_discovery_config_update(client: DataMasqueClient, disc
327341 "id" : CONFIG_ID_1 ,
328342 "name" : "test_config" ,
329343 "config_yaml" : "labels: []" ,
344+ "config_type" : "database" ,
330345 "archived" : False ,
331346 "created" : "2025-06-01T10:00:00Z" ,
332347 "modified" : "2025-06-01T10:00:00Z" ,
@@ -335,6 +350,7 @@ def test_create_or_update_discovery_config_update(client: DataMasqueClient, disc
335350 "id" : CONFIG_ID_1 ,
336351 "name" : "test_config" ,
337352 "config_yaml" : "labels: []\n metadata_rules: []\n idd_rules: []\n " ,
353+ "config_type" : "database" ,
338354 "archived" : False ,
339355 "created" : "2025-06-01T10:00:00Z" ,
340356 "modified" : "2025-06-02T10:00:00Z" ,
@@ -403,6 +419,7 @@ def test_delete_discovery_config_by_name_raises_when_server_omits_id(client: Dat
403419 "results" : [
404420 {
405421 "name" : "my_config" ,
422+ "config_type" : "database" ,
406423 "archived" : False ,
407424 "created" : "2025-01-01T12:00:00Z" ,
408425 "modified" : "2025-01-02T12:00:00Z" ,
@@ -441,6 +458,7 @@ def test_discovery_config_parses_validation_fields() -> None:
441458 {
442459 "id" : CONFIG_ID_1 ,
443460 "name" : "my_config" ,
461+ "config_type" : "database" ,
444462 "config_yaml" : "labels: []" ,
445463 "is_valid" : "invalid" ,
446464 "validation_error" : "bad shape on line 3" ,
@@ -459,6 +477,7 @@ def test_discovery_config_validation_fields_optional() -> None:
459477 {
460478 "id" : CONFIG_ID_1 ,
461479 "name" : "my_config" ,
480+ "config_type" : "database" ,
462481 "created" : "2025-01-01T12:00:00Z" ,
463482 "modified" : "2025-01-02T12:00:00Z" ,
464483 }
@@ -474,11 +493,11 @@ def test_unwrap_discovery_config_id_passes_through_strings() -> None:
474493
475494
476495def test_unwrap_discovery_config_id_extracts_id_from_model () -> None :
477- config = DiscoveryConfig (name = "x" , id = DiscoveryConfigId (CONFIG_ID_1 ))
496+ config = DiscoveryConfig (name = "x" , config_type = "database" , id = DiscoveryConfigId (CONFIG_ID_1 ))
478497 assert unwrap_discovery_config_id (config ) == CONFIG_ID_1
479498
480499
481500def test_unwrap_discovery_config_id_raises_without_id () -> None :
482- config = DiscoveryConfig (name = "x" )
501+ config = DiscoveryConfig (name = "x" , config_type = "database" )
483502 with pytest .raises (ValueError , match = "id is None" ):
484503 unwrap_discovery_config_id (config )
0 commit comments