8000 Fix waterfall test (add accessor set) by daveta · Pull Request #149 · microsoft/botbuilder-python · GitHub
[go: up one dir, main page]

Skip to content

Fix waterfall test (add accessor set) #149

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 1, 2019
Merged
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
< 8000 /div>
Diff view
< D571 tr data-hunk="903964d357379cb7656f14f2378354c1dd77fb6e07a90dd2df442e7da711746e" class="show-top-border">
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
from botbuilder.dialogs import (
Dialog,
DialogSet,
DialogState,
WaterfallDialog,
WaterfallStepContext,
DialogTurnResult,
Expand All @@ -45,8 +46,8 @@ def test_none_telemetry_client(self):
# assert
self.assertEqual(type(dialog.telemetry_client), NullTelemetryClient)

@skip('Pending Telemetry mock')
@patch('test_telemetry_waterfall.ApplicationInsightsTelemetryClient')

@patch('botbuilder.applicationinsights.ApplicationInsightsTelemetryClient')
async def test_execute_sequence_waterfall_steps(self, MockTelemetry):
# arrange

Expand All @@ -56,7 +57,7 @@ async def test_execute_sequence_waterfall_steps(self, MockTelemetry):


# Create a DialogState property, DialogSet and register the WaterfallDialog.
dialog_state = convo_state.create_property('dialogState')
dialog_state = convo_state.create_property('dialogState')
dialogs = DialogSet(dialog_state)
async def step1(step) -> DialogTurnResult:
await step.context.send_activity('bot responding.')
Expand All @@ -82,6 +83,8 @@ async def exec_test(turn_context: TurnContext) -> None:
else:
if results.status == DialogTurnStatus.Complete:
await turn_context.send_activity(results.result)

await dialog_state.set(turn_context, DialogState(dc.stack))
await convo_state.save_changes(turn_context)

adapt = TestAdapter(exec_test)
Expand All @@ -100,8 +103,8 @@ async def exec_test(turn_context: TurnContext) -> None:
]
self.assert_telemetry_calls(telemetry, telemetry_calls)

@skip('Pending Telemetry mock')
@patch('test_telemetry_waterfall.ApplicationInsightsTelemetryClient')

@patch('botbuilder.applicationinsights.ApplicationInsightsTelemetryClient')
async def test_ensure_end_dialog_called(self, MockTelemetry):
# arrange

Expand Down Expand Up @@ -134,6 +137,7 @@ async def exec_test(turn_context: TurnContext) -> None:
results = await dc.continue_dialog()
if turn_context.responded == False:
await dc.begin_dialog("test", None)
await dialog_state.set(turn_context, DialogState(dc.stack))
await convo_state.save_changes(turn_context)

adapt = TestAdapter(exec_test)
Expand Down
0