예제 #1
0
파일: utils_tests.py 프로젝트: achew22/err
    def test_XMPP_participant_jid_from_MUC_message_hipchat(self):
        # Real message from Hipchat MUC
        msg_txt = """
                <message xmlns="jabber:client" to="[email protected]/HipchatBot" type="groupchat" from="[email protected]/Guillaume BINET">
                   <body>test</body>
                   <x xmlns="http://hipchat.com"><sender>[email protected]</sender></x>
                </message>"""

        message = Message(node=msg_txt)
        self.assertEqual(str(get_jid_from_message(message)),
                         "*****@*****.**")
예제 #2
0
파일: server.py 프로젝트: Abitbol/abitbol
def test():

	client = Client('localhost')

	def message_handler(conn, mess_node):
		client.send(Message('tim@localhost', 'reponse!'))

	if not client.connect(server=('127.0.0.1', 5222)):
		raise IOError('Can not connect to server.')

	if not client.auth('abitbol', 'abitbol', 'abitbol'):
		raise IOError('Can not auth with server.')

	client.RegisterHandler('message', message_handler)

	client.sendInitPresence()

	client.send(Message('tim@localhost', 'Test message'))

	while 1:
		client.Process(1)
예제 #3
0
파일: server.py 프로젝트: Abitbol/abitbol
	def message_handler(conn, mess_node):
		client.send(Message('tim@localhost', 'reponse!'))
예제 #4
0
파일: xmpppy.py 프로젝트: Abitbol/abitbol
 def send(self, destination, action):
     self.client.send(Message('tim@localhost', str(action)))