def test_list_rooms_only_one(self): self.assert_in_room(False) self.create_and_join_room() self.assert_in_room(True) act = self.activity_for_list_rooms() response_data = api.on_list_rooms(act, as_parser(act)) self.assertEqual(1, len(response_data[1]['object']['attachments']))
def test_list_rooms_status_code_200(self): self.assert_in_room(False) self.create_and_join_room() self.assert_in_room(True) act = self.activity_for_list_rooms() response_data = api.on_list_rooms(act, as_parser(act)) self.assertEqual(200, response_data[0])
def test_list_rooms_correct_id(self): self.assert_in_room(False) self.create_and_join_room() self.assert_in_room(True) act = self.activity_for_list_rooms() response_data = api.on_list_rooms(act, as_parser(act)) self.assertEqual(ApiListRoomsTest.ROOM_ID, response_data[1]['object']['attachments'][0]['id'])
def on_list_rooms(data: dict, activity: Activity) -> (int, Union[str, dict, None]): return api.on_list_rooms(data, activity)
def test_list_rooms_attachments_empty_if_no_rooms(self): self.assert_in_room(False) act = self.activity_for_list_rooms() response_data = api.on_list_rooms(act, as_parser(act)) self.assertEqual(0, len(response_data[1]['object']['attachments']))
def test_list_rooms_status_code_200_if_no_rooms(self): self.assert_in_room(False) act = self.activity_for_list_rooms() response_data = api.on_list_rooms(act, as_parser(act)) self.assertEqual(200, response_data[0])