# -*- coding: utf-8 -*-

# Copyright (C) 2021 Avencall
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>

import unittest
from mock import Mock, patch, call
from xivo_agid.modules import incoming_meetingroom_set_features


class TestSetDialplanVars(unittest.TestCase):

    def setUp(self):
        self.agi = Mock()
        self.queue = Mock()
        self.queue.name = "meeting_room_1"

    @patch('xivo_agid.objects.MeetingRoom')
    def test_get_meeting_room_name(self, mock_meeting_room):
        self.agi.get_variable.return_value = 1
        mock_meeting_room.return_value = self.queue

        expected_calls = [
            call('XIVO_MEETING_ROOM', 'meeting_room_1'),
        ]

        incoming_meetingroom_set_features.incoming_meetingroom_set_features(self.agi)

        self.assertEqual(self.agi.set_variable.call_args_list, expected_calls)
