Skip to content
Merged
Show file tree
Hide file tree
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
Diff view
30 changes: 30 additions & 0 deletions libraries/botbuilder-core/tests/teams/test_teams_channel_data.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.

import aiounittest

from botbuilder.schema import Activity
from botbuilder.schema.teams import TeamsChannelData
from botbuilder.core.teams import teams_get_team_info


class TestTeamsChannelData(aiounittest.AsyncTestCase):
def test_teams_aad_group_id_deserialize(self):
# Arrange
raw_channel_data = {"team": {"aadGroupId": "teamGroup123"}}

# Act
channel_data = TeamsChannelData().deserialize(raw_channel_data)

# Assert
assert channel_data.team.aad_group_id == "teamGroup123"

def test_teams_get_team_info(self):
# Arrange
activity = Activity(channel_data={"team": {"aadGroupId": "teamGroup123"}})

# Act
team_info = teams_get_team_info(activity)

# Assert
assert team_info.aad_group_id == "teamGroup123"
Original file line number Diff line number Diff line change
Expand Up @@ -1508,17 +1508,21 @@ class TeamInfo(Model):
:type id: str
:param name: Name of team.
:type name: str
:param name: Azure AD Teams group ID.
:type name: str
"""

_attribute_map = {
"id": {"key": "id", "type": "str"},
"name": {"key": "name", "type": "str"},
"aad_group_id": {"key": "aadGroupId", "type": "str"},
}

def __init__(self, **kwargs):
super(TeamInfo, self).__init__(**kwargs)
self.id = kwargs.get("id", None)
self.name = kwargs.get("name", None)
self.aad_group_id = kwargs.get("aad_group_id", None)


class TeamsChannelAccount(ChannelAccount):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1773,17 +1773,23 @@ class TeamInfo(Model):
:type id: str
:param name: Name of team.
:type name: str
:param name: Azure AD Teams group ID.
:type name: str
"""

_attribute_map = {
"id": {"key": "id", "type": "str"},
"name": {"key": "name", "type": "str"},
"aad_group_id": {"key": "aadGroupId", "type": "str"},
}

def __init__(self, *, id: str = None, name: str = None, **kwargs) -> None:
def __init__(
self, *, id: str = None, name: str = None, aad_group_id: str = None, **kwargs
) -> None:
super(TeamInfo, self).__init__(**kwargs)
self.id = id
self.name = name
self.aad_group_id = aad_group_id


class TeamsChannelAccount(ChannelAccount):
Expand Down