From 4981a0ec74c8b082f4e360f88224658ea5b9e787 Mon Sep 17 00:00:00 2001 From: Eden Zimbelman Date: Mon, 17 Aug 2026 23:06:23 -0700 Subject: [PATCH] docs(agents): document registering new methods in the coverage test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adding a Web API method requires registering it in tests/slack_sdk_async/web/test_web_client_coverage.py — both in the all_api_methods list and, for methods with required args, a call branch in run_method. A method absent from the list is not exercised even though the suite passes, so document this step alongside the Web API method pattern. Co-Authored-By: Claude --- AGENTS.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/AGENTS.md b/AGENTS.md index c84747d9f..b1f1d2b40 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -106,6 +106,17 @@ Key conventions: - The `api_call` method name uses Slack's dot-notation (e.g., `"chat.postMessage"`) - Docstrings include a link to the Slack API reference +### Registering a New Method in the Coverage Test + +When you add a Web API method, you **must** also register it in the method coverage test, or it will silently go unexercised: + +`tests/slack_sdk_async/web/test_web_client_coverage.py` + +1. Add the API method name (dot-notation, e.g. `"chat.postMessage"`) to the `all_api_methods` string. +2. If the method has **required** arguments, add an `elif method_name == "":` branch in `run_method` that calls it with sample arguments (the generic `else` only works for methods with no required args). + +The test calls every method in `all_api_methods` against the mock API server and asserts none were left uncalled. A method absent from the list is **not** covered even though the suite passes — the list is the source of truth for coverage. + ### Error Types All SDK exceptions are defined in `slack_sdk/errors/__init__.py` and inherit from `SlackClientError`.