File tree Expand file tree Collapse file tree 2 files changed +22
-2
lines changed
libraries/botbuilder-core Expand file tree Collapse file tree 2 files changed +22
-2
lines changed Original file line number Diff line number Diff line change @@ -22,8 +22,8 @@ async def send_message_to_teams_channel(
22
22
) -> Tuple [ConversationReference , str ]:
23
23
if not turn_context :
24
24
raise ValueError ("The turn_context cannot be None" )
25
- if not turn_context . activity :
26
- raise ValueError ("The turn_context. activity cannot be None" )
25
+ if not activity :
26
+ raise ValueError ("The activity cannot be None" )
27
27
if not teams_channel_id :
28
28
raise ValueError ("The teams_channel_id cannot be None or empty" )
29
29
Original file line number Diff line number Diff line change 13
13
14
14
15
15
class TestTeamsInfo (aiounittest .AsyncTestCase ):
16
+ async def test_send_message_to_teams_channels_without_activity (self ):
17
+ def create_conversation ():
18
+ pass
19
+
20
+ adapter = SimpleAdapterWithCreateConversation (
21
+ call_create_conversation = create_conversation
22
+ )
23
+
24
+ activity = Activity ()
25
+ turn_context = TurnContext (adapter , activity )
26
+
27
+ try :
28
+ await TeamsInfo .send_message_to_teams_channel (
29
+ turn_context , None , "channelId123"
30
+ )
31
+ except ValueError :
32
+ pass
33
+ else :
34
+ assert False , "should have raise ValueError"
35
+
16
36
async def test_send_message_to_teams (self ):
17
37
def create_conversation ():
18
38
pass
You can’t perform that action at this time.
0 commit comments