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
1 change: 1 addition & 0 deletions ietf/meeting/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -1099,6 +1099,7 @@ def create_interim_session_conferences(sessions):
try:
confs = meetecho_manager.create(
group=session.group,
session_id=session.pk,
description=str(session),
start_time=ts.utc_start_time(),
duration=ts.duration,
Expand Down
25 changes: 14 additions & 11 deletions ietf/meeting/tests_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,7 @@ def test_create_interim_session_conferences(self, mock):
mock.reset_mock()
mock_conf_mgr.create.return_value = [
Conference(
manager=mock_conf_mgr, id=1, public_id='some-uuid', description='desc',
manager=mock_conf_mgr, id=int(sessions[0].pk), public_id='some-uuid', description='desc',
start_time=timeslots[0].utc_start_time(), duration=timeslots[0].duration, url='fake-meetecho-url',
deletion_token='please-delete-me',
),
Expand All @@ -498,6 +498,7 @@ def test_create_interim_session_conferences(self, mock):
mock_conf_mgr.create.call_args[1],
{
'group': sessions[0].group,
'session_id': sessions[0].id,
'description': str(sessions[0]),
'start_time': timeslots[0].utc_start_time(),
'duration': timeslots[0].duration,
Expand All @@ -512,12 +513,12 @@ def test_create_interim_session_conferences(self, mock):
mock.reset_mock()
mock_conf_mgr.create.side_effect = [
[Conference(
manager=mock_conf_mgr, id=1, public_id='some-uuid', description='desc',
manager=mock_conf_mgr, id=int(sessions[0].pk), public_id='some-uuid', description='desc',
start_time=timeslots[0].utc_start_time(), duration=timeslots[0].duration, url='different-fake-meetecho-url',
deletion_token='please-delete-me',
)],
[Conference(
manager=mock_conf_mgr, id=2, public_id='another-uuid', description='desc',
manager=mock_conf_mgr, id=int(sessions[1].pk), public_id='another-uuid', description='desc',
start_time=timeslots[1].utc_start_time(), duration=timeslots[1].duration, url='another-fake-meetecho-url',
deletion_token='please-delete-me-too',
)],
Expand All @@ -528,16 +529,18 @@ def test_create_interim_session_conferences(self, mock):
mock_conf_mgr.create.call_args_list,
[
({
'group': sessions[0].group,
'description': str(sessions[0]),
'start_time': timeslots[0].utc_start_time(),
'duration': timeslots[0].duration,
'group': sessions[0].group,
'session_id': sessions[0].id,
'description': str(sessions[0]),
'start_time': timeslots[0].utc_start_time(),
'duration': timeslots[0].duration,
},),
({
'group': sessions[1].group,
'description': str(sessions[1]),
'start_time': timeslots[1].utc_start_time(),
'duration': timeslots[1].duration,
'group': sessions[1].group,
'session_id': sessions[1].id,
'description': str(sessions[1]),
'start_time': timeslots[1].utc_start_time(),
'duration': timeslots[1].duration,
},),
]
)
Expand Down
6 changes: 5 additions & 1 deletion ietf/utils/meetecho.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ def retrieve_wg_tokens(self, acronyms: Union[str, Sequence[str]]):
def schedule_meeting(
self,
wg_token: str,
room_id: int,
description: str,
start_time: datetime.datetime,
duration: datetime.timedelta,
Expand All @@ -139,6 +140,7 @@ def schedule_meeting(
}

:param wg_token: token retrieved via retrieve_wg_tokens()
:param room_id: int id to identify the room (will be echoed as room.id)
:param description: str describing the meeting
:param start_time: starting time as a datetime
:param duration: duration as a timedelta
Expand All @@ -151,6 +153,7 @@ def schedule_meeting(
"meeting/interim/createRoom",
api_token=wg_token,
json={
"room_id": room_id,
"description": description,
"start_time": self._serialize_time(start_time),
"duration": self._serialize_duration(duration),
Expand Down Expand Up @@ -455,9 +458,10 @@ def fetch(self, group):
response = self.api.fetch_meetings(self.wg_token(group))
return Conference.from_api_dict(self, response["rooms"])

def create(self, group, description, start_time, duration, extrainfo=""):
def create(self, group, session_id, description, start_time, duration, extrainfo=""):
response = self.api.schedule_meeting(
wg_token=self.wg_token(group),
room_id=int(session_id),
description=description,
start_time=start_time,
duration=duration,
Expand Down
9 changes: 6 additions & 3 deletions ietf/utils/tests_meetecho.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def test_schedule_meeting(self):
'rooms': {
'3d55bce0-535e-4ba8-bb8e-734911cf3c32': {
'room': {
'id': 18,
'id': 18, # should match room_id in api.schedule_meeting() below
'start_time': '2021-09-14 10:00:00',
'duration': 130,
'description': 'interim-2021-wgname-01',
Expand All @@ -97,6 +97,7 @@ def test_schedule_meeting(self):
api = MeetechoAPI(API_BASE, CLIENT_ID, CLIENT_SECRET)
api_response = api.schedule_meeting(
wg_token='my-token',
room_id=18,
start_time=datetime.datetime(2021, 9, 14, 10, 0, 0, tzinfo=datetime.timezone.utc),
duration=datetime.timedelta(minutes=130),
description='interim-2021-wgname-01',
Expand All @@ -116,6 +117,7 @@ def test_schedule_meeting(self):
self.assertEqual(
request.json(),
{
'room_id': 18,
'duration': 130,
'start_time': '2021-09-14 10:00:00',
'extrainfo': 'message for staff',
Expand Down Expand Up @@ -485,7 +487,7 @@ def test_create(self, mock_schedule, _):
'rooms': {
'session-1-uuid': {
'room': {
'id': 1,
'id': 1, # value should match session_id param to cm.create() below
'start_time': datetime.datetime(2022,2,4,1,2,3, tzinfo=datetime.timezone.utc),
'duration': datetime.timedelta(minutes=45),
'description': 'some-description',
Expand All @@ -496,7 +498,7 @@ def test_create(self, mock_schedule, _):
},
}
cm = ConferenceManager(settings.MEETECHO_API_CONFIG)
result = cm.create('group', 'desc', 'starttime', 'dur', 'extra')
result = cm.create('group', '1', 'desc', 'starttime', 'dur', 'extra')
self.assertEqual(
result,
[Conference(
Expand All @@ -515,6 +517,7 @@ def test_create(self, mock_schedule, _):
kwargs,
{
'wg_token': 'atoken',
'room_id': 1,
'description': 'desc',
'start_time': 'starttime',
'duration': 'dur',
Expand Down