Ignore:
Timestamp:
Jul 21, 2009, 8:00:12 PM (13 years ago)
Author:
Ralph Meijer <ralphm@…>
Branch:
default
Convert:
svn:b33ecbfc-034c-dc11-8662-000475d9059e/trunk@190
Message:

Add a jid attribute to XMPPClient that is updated with the current JID.

Author: ralphm.
Fixes #18.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • wokkel/test/test_client.py

    r61 r72  
    2121from wokkel import client
    2222from wokkel.test.test_compat import BootstrapMixinTest
     23
     24class XMPPClientTest(unittest.TestCase):
     25    """
     26    Tests for L{client.XMPPClient}.
     27    """
     28
     29    def setUp(self):
     30        self.client = client.XMPPClient(JID('user@example.org'), 'secret')
     31
     32
     33    def test_jid(self):
     34        """
     35        Make sure the JID we pass is stored on the client.
     36        """
     37        self.assertEquals(JID('user@example.org'), self.client.jid)
     38
     39
     40    def test_jidWhenInitialized(self):
     41        """
     42        Make sure that upon login, the JID is updated from the authenticator.
     43        """
     44        xs = self.client.factory.buildProtocol(None)
     45        self.client.factory.authenticator.jid = JID('user@example.org/test')
     46        xs.dispatch(xs, xmlstream.STREAM_AUTHD_EVENT)
     47        self.assertEquals(JID('user@example.org/test'), self.client.jid)
     48
     49
    2350
    2451class DeferredClientFactoryTest(BootstrapMixinTest):
Note: See TracChangeset for help on using the changeset viewer.