Spaces:
Running
Running
Jeremiah Lowin commited on
Commit ·
093e715
1
Parent(s): ef06ced
Update test_mount.py
Browse files- tests/server/test_mount.py +13 -0
tests/server/test_mount.py
CHANGED
|
@@ -304,6 +304,19 @@ class TestDynamicChanges:
|
|
| 304 |
tools = await main_app.get_tools()
|
| 305 |
assert "sub_temp_tool" not in tools
|
| 306 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 307 |
|
| 308 |
class TestResourcesAndTemplates:
|
| 309 |
"""Test mounting with resources and resource templates."""
|
|
|
|
| 304 |
tools = await main_app.get_tools()
|
| 305 |
assert "sub_temp_tool" not in tools
|
| 306 |
|
| 307 |
+
async def test_cache_expiration(self):
|
| 308 |
+
main_app = FastMCP("MainApp", cache_expiration_seconds=2)
|
| 309 |
+
sub_app = FastMCP("SubApp")
|
| 310 |
+
tools = await main_app.get_tools()
|
| 311 |
+
assert len(tools) == 0
|
| 312 |
+
|
| 313 |
+
@sub_app.tool
|
| 314 |
+
def sub_tool():
|
| 315 |
+
return "sub_tool"
|
| 316 |
+
|
| 317 |
+
tools = await main_app.get_tools()
|
| 318 |
+
assert len(tools) == 0
|
| 319 |
+
|
| 320 |
|
| 321 |
class TestResourcesAndTemplates:
|
| 322 |
"""Test mounting with resources and resource templates."""
|