File: test_basic_connect_and_message.py

package info (click to toggle)
slixmpp 1.13.0-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 5,520 kB
  • sloc: python: 41,715; xml: 1,197; makefile: 120
file content (28 lines) | stat: -rw-r--r-- 873 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import unittest
from slixmpp.test.integration import SlixIntegration


class TestConnect(SlixIntegration):
    async def asyncSetUp(self):
        await super().asyncSetUp()
        self.add_client(
            self.envjid('CI_ACCOUNT1'),
            self.envstr('CI_ACCOUNT1_PASSWORD'),
        )
        self.add_client(
            self.envjid('CI_ACCOUNT2'),
            self.envstr('CI_ACCOUNT2_PASSWORD'),
        )
        await self.connect_clients()

    async def test_send_message(self):
        """Make sure we can send and receive messages"""
        msg = self.clients[0].make_message(
            mto=self.clients[1].boundjid, mbody='Msg body',
        )
        msg.send()
        message = await self.clients[1].wait_until('message')
        self.assertEqual(message['body'], msg['body'])


suite = unittest.TestLoader().loadTestsFromTestCase(TestConnect)