Skip to content

Agent Zero AI framework

Keep the rate limiter demo out of test collection

Alessandro8cb177abac30
diff --git a/tests/AGENTS.md b/tests/AGENTS.md
index 39ea8763b..6e97fb72d 100644
--- a/tests/AGENTS.md
+++ b/tests/AGENTS.md
@@ -13,7 +13,7 @@
## Local Contracts
-- Tests must not require real API keys, network-only services, private user data, or local `usr/` runtime state.
+- Tests must not require real API keys, network-only services, private user data, or local `usr/` runtime state. Manual provider demos must guard model creation and requests behind their executable entry point so collection never runs them.
- Keep tests deterministic and isolated from existing chats, uploads, downloads, plugin state, and settings.
- Prefer exercising public helper/API contracts over fragile implementation details when practical.
- Security regression tests should assert the protected behavior directly.
diff --git a/tests/rate_limiter_test.py b/tests/rate_limiter_test.py
index ac0aa52fe..630a45e71 100644
--- a/tests/rate_limiter_test.py
+++ b/tests/rate_limiter_test.py
@@ -3,23 +3,23 @@ import sys, os
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
import models
-provider = "openrouter"
-name = "deepseek/deepseek-r1"
+async def run():
+ provider = "openrouter"
+ name = "deepseek/deepseek-r1"
-model = models.get_chat_model(
- provider=provider,
- name=name,
- model_config=models.ModelConfig(
- type=models.ModelType.CHAT,
+ model = models.get_chat_model(
provider=provider,
name=name,
- limit_requests = 5,
- limit_input = 15000,
- limit_output = 1000,
- )
- )
+ model_config=models.ModelConfig(
+ type=models.ModelType.CHAT,
+ provider=provider,
+ name=name,
+ limit_requests = 5,
+ limit_input = 15000,
+ limit_output = 1000,
+ )
+ )
-async def run():
response, reasoning = await model.unified_call(
user_message="Tell me a joke"
)
@@ -28,4 +28,5 @@ async def run():
import asyncio
-asyncio.run(run())
\ No newline at end of file
+if __name__ == "__main__":
+ asyncio.run(run())