dialog_test_client モジュール

クラス

DialogTestClient

ダイアログを分離してテストするためのクライアント。

本格的なアダプターを作成しなくてもダイアログをテストする DialogTestClient を作成します。

python client = DialogTestClient("test", MY_DIALOG, MY_OPTIONS) reply = await client.send_activity("first message") self.assertEqual(reply.text, "first reply", "reply failed")

チャネル ID の場合は、ターゲットとするチャネルが不明な場合は、"エミュレーター" または "テスト" を使用します。 それ以外の場合は、ボットが使用するチャネルの ID を使用し、各チャネルのテスト ケースを記述することをお勧めします。 または、テスト アダプター インスタンスを使用できます。 :type channel_or_adapter: Union[str, TestAdapter] :p aram target_dialog: テストするダイアログ。 これはテスト クライアントのルート ダイアログです。 :type target_dialog: Dialog :p aram initial_dialog_options: (省略可能) 開始中のダイアログに渡す追加の引数。 :type initial_dialog_options: object :p aram middlewares: (省略可能) 使用するテスト アダプター。 このパラメーターが指定されていない場合、テスト クライアントは既定の TestAdapter を使用します。 :type ミドルウェア: List[ミドルウェア] :p aram conversation_state: (省略可能) テスト クライアントで使用する ConversationState インスタンス。 :type conversation_state: ConversationState