Welcome to mirror list, hosted at ThFree Co, Russian Federation.

util.py « lib « test - dev.gajim.org/gajim/python-nbxmpp.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 2bb3b263d4b5b4f215f8e88be7c1fc389d496924 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import unittest
from unittest.mock import Mock

from test.lib.const import STREAM_START

from nbxmpp.dispatcher import StanzaDispatcher
from nbxmpp.protocol import JID


class StanzaHandlerTest(unittest.TestCase):
    def setUp(self):
        # Setup mock client
        self.client = Mock()
        self.client.is_websocket = False
        self.dispatcher = StanzaDispatcher(self.client)

        self.client.get_bound_jid.return_value = JID.from_string('test@test.test')

        self.dispatcher.reset_parser()
        self.dispatcher.process_data(STREAM_START)