Example #1
0
 def fill_conf(self):
     self.xc_json.update(cti_main_dao.get_config())
     self.xc_json['displays'] = cti_displays_dao.get_config()
     self.xc_json['contexts'] = cti_context_dao.get_config()
     self.xc_json['profiles'] = self._get_profiles()
     self.xc_json['services'] = self._get_services()
     self.xc_json['preferences'] = self._get_preferences()
     self.xc_json['phonestatus'] = cti_phonehints_dao.get_config()
     self.xc_json['userstatus'] = cti_userstatus_dao.get_config()
     self.xc_json['sheets'] = cti_sheets_dao.get_config()
     self.xc_json['directories'] = cti_directories_dao.get_config()
Example #2
0
 def fill_conf(self):
     self.xc_json.update(cti_main_dao.get_config())
     self.xc_json['displays'] = cti_displays_dao.get_config()
     self.xc_json['contexts'] = cti_context_dao.get_config()
     self.xc_json['profiles'] = self._get_profiles()
     self.xc_json['services'] = self._get_services()
     self.xc_json['preferences'] = self._get_preferences()
     self.xc_json['phonestatus'] = cti_phonehints_dao.get_config()
     self.xc_json['userstatus'] = cti_userstatus_dao.get_config()
     self.xc_json['sheets'] = cti_sheets_dao.get_config()
     self.xc_json['directories'] = cti_directories_dao.get_config()
     self.xc_json['uuid'] = info_services.get().uuid
    def test_get_config(self):
        expected_result = {
            "test1": {
                "available": {
                    "longname": "available",
                    "color": "#08FD20"
                },
                "disconnected": {
                    "longname": "disconnected",
                    "color": "#202020"
                }
            },
            "test2": {
                "available": {
                    "longname": "available",
                    "color": "#08FD20",
                    "actions": {"enablednd": "false",
                                "queuepause_all": ""}
                },
                "disconnected": {
                    "longname": "disconnected",
                    "color": "#202020",
                    "allowed": ["available"],
                    "actions": {"agentlogoff": ""}
                }
            }
        }

        cti_presence_id_1 = self._add_presence('test1')
        self._add_status(cti_presence_id_1, 'available', '', '#08FD20', '')
        self._add_status(cti_presence_id_1, 'disconnected', '', '#202020', '')

        cti_presence_id_2 = self._add_presence('test2')
        actions = 'enablednd(false),queuepause_all()'
        status_id = self._add_status(cti_presence_id_2, 'available', actions, '#08FD20', '')
        actions = 'agentlogoff()'
        self._add_status(cti_presence_id_2, 'disconnected', actions, '#202020', '%s' % status_id)

        result = cti_userstatus_dao.get_config()

        self.assertEqual(expected_result, result)
    def test_get_config_status_with_inexistant_access_status(self):
        expected_result = {
            "test1": {
                "available": {
                    "longname": "available",
                    "color": "#08FD20"
                },
                "invalid": {
                    "longname": "invalid",
                    "color": "#303030"
                }
            }
        }

        cti_presence_id_1 = self._add_presence('test1')
        self._add_status(cti_presence_id_1, 'available', '', '#08FD20', '')
        self._add_status(cti_presence_id_1, 'invalid', '', '#303030', '0')

        result = cti_userstatus_dao.get_config()

        self.assertEqual(expected_result, result)
    def test_get_config_status_with_invalid_access_status(self):
        expected_result = {
            "test1": {
                "available": {
                    "longname": "available",
                    "color": "#08FD20"
                },
                "away": {
                    "longname": "away",
                    "color": "#101010",
                    "allowed": ["available"],
                }
            }
        }

        cti_presence_id_1 = self._add_presence('test1')
        status_id_1 = self._add_status(cti_presence_id_1, 'available', '', '#08FD20', '')

        invalid_access_status = '%s,0' % status_id_1
        self._add_status(cti_presence_id_1, 'away', '', '#101010', invalid_access_status)

        result = cti_userstatus_dao.get_config()

        self.assertEqual(expected_result, result)