Document about the ways to write unit tests for Bolt apps
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 48/100
- issue の種類
- ドキュメント
- 明瞭さ
- おおむね明確
- 活発さ
- 静か
- 技術スタック
- python
調査の方向性
https://slack.dev/bolt-python/ の Bolt for Python ドキュメントから始め、main.py と api.py に示されているハンドラー構造を確認します。これには app.command、app.event、app.db、ack、respond が含まれます。これらのハンドラーの単体テストについて、ハンドラーの引数と app の依存関係に対するテストダブルを含む、妥当なアプローチを、期待される動作が明確になる例とともに文書化します。
索引モデルが issue の本文から書いたものです。
説明
I am looking to write unit tests for my Bolt API, which consists of an app with several handlers for events / messages. The handlers are both decorated using the app.event decorator, and make use of the app object to access things like the db connection that has been put on it. For example:
# in main.py
app = App(
token=APP_TOKEN,
signing_secret=SIGNING_SECRET,
process_before_response=True,
token_verification_enabled=token_verification_enabled,
)
app.db = db
# in api.py:
from .main import app
@app.command("/slashcommand")
def slash_command(ack, respond):
ack()
results = app.db.do_query()
respond(...)
The thing is, I cannot find any framework pointers, or documentation, on how I would write reasonable unit tests for this. Presumably ones where the kwargs like ack and respond are replaced by test doubles. How do I do this?
The page URLs
Requirements
Please read the Contributing guidelines and Code of Conduct before creating this issue or pull request. By submitting, you are agreeing to those rules.
- 主要言語
- Python
- スター
- 1.3k
- フォーク
- 288
- 平均マージ
- 1日 8時間
- マージ済み PR(30日)
- 10
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
slackapi/bolt-python のほかの issue
-
docs enhancement server-side
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
slackapi/bolt-python#1576 · コメント 1 件 ·
-
auto-triage-skip bug security semver:major
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
slackapi/bolt-python#1447 · コメント 9 件 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 65/100
slackapi/bolt-python#1577 ·
-
area:async auto-triage-skip dependencies
難易度 3/5 1〜2日 初心者へのやさしさ 65/100
slackapi/bolt-python#1472 · コメント 1 件 · リアクション 1 件 ·
-
auto-triage-skip enhancement
slackapi/bolt-python#1346 · コメント 2 件 · 担当者 1 名 ·
slackapi/bolt-python の issue をすべて見る
似ている issue
-
fix: inaccuracy ⚠️
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
uabrc/uabrc.github.io#1255 · コメント 1 件 ·
-
kind:bug needs-triage
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
-
docs
難易度 1/5 1時間未満 初心者へのやさしさ 85/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
ethereum-optimism/factory#64 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100