@@ -61,6 +61,45 @@ async def test_search_no_results() -> None:
61
61
assert list (res .keys ()) == ["total" , "facets" ]
62
62
63
63
64
+ @pytest .mark .anyio
65
+ async def test_search_simple_filter (mcp_client : Client ) -> None :
66
+ filters_json = {"platform" : ["looker" ]}
67
+ res = await mcp_client .call_tool (
68
+ "search" ,
69
+ arguments = {"query" : "*" , "filters" : filters_json },
70
+ )
71
+ assert res .is_error is False
72
+ assert res .data is not None
73
+
74
+
75
+ @pytest .mark .anyio
76
+ async def test_search_string_filter (mcp_client : Client ) -> None :
77
+ filters_json = {"platform" : ["looker" ]}
78
+ res = await mcp_client .call_tool (
79
+ "search" ,
80
+ arguments = {"query" : "*" , "filters" : json .dumps (filters_json )},
81
+ )
82
+ assert res .is_error is False
83
+ assert res .data is not None
84
+
85
+
86
+ @pytest .mark .anyio
87
+ async def test_search_complex_filter (mcp_client : Client ) -> None :
88
+ filters_json = {
89
+ "and" : [
90
+ {"entity_type" : ["DATASET" ]},
91
+ {"entity_subtype" : ["Table" ]},
92
+ {"not" : {"platform" : ["snowflake" ]}},
93
+ ]
94
+ }
95
+ res = await mcp_client .call_tool (
96
+ "search" ,
97
+ arguments = {"query" : "*" , "filters" : filters_json },
98
+ )
99
+ assert res .is_error is False
100
+ assert res .data is not None
101
+
102
+
64
103
@pytest .mark .anyio
65
104
async def test_get_dataset () -> None :
66
105
res = await get_entity .fn (_test_urn )
@@ -90,20 +129,3 @@ async def test_get_lineage() -> None:
90
129
async def test_get_dataset_queries () -> None :
91
130
res = await get_dataset_queries .fn (_test_urn )
92
131
assert res is not None
93
-
94
-
95
- @pytest .mark .anyio
96
- async def test_search (mcp_client : Client ) -> None :
97
- filters_json = {
98
- "and" : [
99
- {"entity_type" : ["DATASET" ]},
100
- {"entity_subtype" : ["Table" ]},
101
- {"not" : {"platform" : ["snowflake" ]}},
102
- ]
103
- }
104
- res = await mcp_client .call_tool (
105
- "search" ,
106
- arguments = {"query" : "*" , "filters" : filters_json },
107
- )
108
- assert res .is_error is False
109
- assert res .data is not None
0 commit comments