Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ readme = "README.md"
requires-python = ">=3.12"
dependencies = [
"anyio>=4.0.0",
"appwrite-console>=0.8.1,<0.9",
"appwrite-console>=0.10.0,<0.11",
"docstring-parser>=0.16",
"mcp[cli]>=2,<3",
"python-dotenv>=1.0.1",
Expand Down
12 changes: 12 additions & 0 deletions tests/unit/test_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -1028,6 +1028,18 @@ def test_advisor_tools_are_project_scoped(self):
{tool["context_scope"] for tool in advisor_tools.values()}, {"project"}
)

def test_waf_rule_tools_take_conditions_as_a_list_of_strings(self):
manager = register_services(object(), profile=OAUTH_PROFILE)
tools = {tool.name: tool for tool in manager.get_all_tools()}
Comment on lines +1031 to +1033

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cover the action-specific WAF get response

The dependency bump is also meant to make waf_get_rule preserve action-specific fields such as difficulty, ttl, and location, but this new test only checks create/update input schemas. A regression to the generic WafRule response would still pass; please add a model or fixture assertion for the richer get response.

Prompt To Fix With AI
This is a comment left during a code review.
Path: tests/unit/test_server.py
Line: 1031-1033

Comment:
**Cover the action-specific WAF get response**

The dependency bump is also meant to make `waf_get_rule` preserve action-specific fields such as `difficulty`, `ttl`, and `location`, but this new test only checks create/update input schemas. A regression to the generic `WafRule` response would still pass; please add a model or fixture assertion for the richer get response.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

🟡 Minor · testing · Reply if this doesn't apply.


for action in ("bypass", "challenge", "deny", "rate_limit", "redirect"):
for verb in ("create", "update"):
name = f"waf_{verb}_{action}_rule"
with self.subTest(tool=name):
conditions = tools[name].input_schema["properties"]["conditions"]
self.assertEqual(conditions["type"], "array")
self.assertEqual(conditions["items"], {"type": "string"})

def test_api_key_profile_only_advertises_server_capabilities(self):
manager = register_services(object(), profile=API_KEY_PROFILE)
service_names = {service.service_name for service in manager.services}
Expand Down
8 changes: 4 additions & 4 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading