File tree 2 files changed +13
-10
lines changed
libraries/botbuilder-dialogs 2 files changed +13
-10
lines changed Original file line number Diff line number Diff line change 1
1
# Copyright (c) Microsoft Corporation. All rights reserved.
2
2
# Licensed under the MIT License.
3
3
4
+ from botframework .connector .auth import (
5
+ ClaimsIdentity ,
6
+ SkillValidation ,
7
+ AuthenticationConstants ,
8
+ GovernmentConstants ,
9
+ )
4
10
from botbuilder .core import BotAdapter , StatePropertyAccessor , TurnContext
5
11
from botbuilder .core .skills import SkillHandler , SkillConversationReference
6
-
7
12
from botbuilder .dialogs import (
8
13
Dialog ,
9
14
DialogEvents ,
10
15
DialogSet ,
11
16
DialogTurnStatus ,
12
17
)
13
- from botbuilder .schema import Activity , ActivityTypes
14
- from botframework .connector .auth import (
15
- ClaimsIdentity ,
16
- SkillValidation ,
17
- AuthenticationConstants ,
18
- GovernmentConstants ,
19
- )
18
+ from botbuilder .schema import Activity , ActivityTypes , EndOfConversationCodes
20
19
21
20
22
21
class DialogExtensions :
@@ -87,6 +86,9 @@ async def run_dialog(
87
86
type = ActivityTypes .end_of_conversation ,
88
87
value = result .result ,
89
88
locale = turn_context .activity .locale ,
89
+ code = EndOfConversationCodes .completed_successfully
90
+ if result .status == DialogTurnStatus .Complete
91
+ else EndOfConversationCodes .user_cancelled ,
90
92
)
91
93
await turn_context .send_activity (activity )
92
94
Original file line number Diff line number Diff line change 7
7
8
8
import aiounittest
9
9
10
+ from botframework .connector .auth import ClaimsIdentity , AuthenticationConstants
10
11
from botbuilder .core import (
11
12
TurnContext ,
12
13
MessageFactory ,
28
29
TranscriptLoggerMiddleware ,
29
30
ConsoleTranscriptLogger ,
30
31
)
31
- from botbuilder .schema import ActivityTypes , Activity
32
- from botframework .connector .auth import ClaimsIdentity , AuthenticationConstants
32
+ from botbuilder .schema import ActivityTypes , Activity , EndOfConversationCodes
33
33
from botbuilder .dialogs import (
34
34
ComponentDialog ,
35
35
TextPrompt ,
@@ -111,6 +111,7 @@ async def handles_bot_and_skills_test_cases(
111
111
self .eoc_sent , "Skills should send EndConversation to channel"
112
112
)
113
113
assert ActivityTypes .end_of_conversation == self .eoc_sent .type
114
+ assert EndOfConversationCodes .completed_successfully == self .eoc_sent .code
114
115
assert self .eoc_sent .value == "SomeName"
115
116
else :
116
117
self .assertIsNone (
You can’t perform that action at this time.
0 commit comments