Fix waterfall test (save with accessor!!)
@@ -23,6 +23,7 @@ from botbuilder.core import (
from botbuilder.dialogs import (
Dialog,
DialogSet,
+ DialogState,
WaterfallDialog,
WaterfallStepContext,
DialogTurnResult,
@@ -45,7 +46,7 @@ class TelemetryWaterfallTests(aiounittest.AsyncTestCase):
# assert
self.assertEqual(type(dialog.telemetry_client), NullTelemetryClient)
- @skip('Pending Telemetry mock')
+
@patch('test_telemetry_waterfall.ApplicationInsightsTelemetryClient')
async def test_execute_sequence_waterfall_steps(self, MockTelemetry):
# arrange
@@ -82,6 +83,8 @@ class TelemetryWaterfallTests(aiounittest.AsyncTestCase):
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)
@@ -100,7 +103,7 @@ class TelemetryWaterfallTests(aiounittest.AsyncTestCase):
]
self.assert_telemetry_calls(telemetry, telemetry_calls)
- @skip('Pending Telemetry mock')
+
@patch('test_telemetry_waterfall.ApplicationInsightsTelemetryClient')
async def test_ensure_end_dialog_called(self, MockTelemetry):
# arrange
@@ -134,6 +137,7 @@ class TelemetryWaterfallTests(aiounittest.AsyncTestCase):
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)
