def test_people_personal_contact_raw_result(self): source = 'personal' source_entry_id = '123456789' contact_infos = {'firstname': 'Bob', 'lastname': 'The Builder'} expected = { 'class': 'people_personal_contact_raw_result', 'source': source, 'source_entry_id': source_entry_id, 'contact_infos': { 'firstname': 'Bob', 'lastname': 'The Builder' } } result = CTIMessageFormatter.people_personal_contact_raw_result( source, source_entry_id, contact_infos) assert_that(result, equal_to(expected))
def _send_personal_contact_raw_result(self, user_id, source, source_entry_id, result): xuserid = 'xivo/{user_id}'.format(user_id=user_id) message = CTIMessageFormatter.people_personal_contact_raw_result(source, source_entry_id, result) self._cti_server.send_to_cti_client(xuserid, message)