Ignore:
Timestamp:
Jul 6, 2009, 9:24:58 AM (13 years ago)
Author:
Ralph Meijer <ralphm@…>
Branch:
default
Convert:
svn:b33ecbfc-034c-dc11-8662-000475d9059e/trunk@174
Message:

Add sender parameter to disco requests.

Author: ralphm
Fixes #52.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • wokkel/test/test_disco.py

    r53 r62  
    515515
    516516
     517    def test_requestItemsFrom(self):
     518        """
     519        A disco items request can be sent with an explicit sender address.
     520        """
     521        d = self.protocol.requestItems(JID(u'example.org'),
     522                                       sender=JID(u'test.example.org'))
     523
     524        iq = self.stub.output[-1]
     525        self.assertEqual(u'test.example.org', iq.getAttribute(u'from'))
     526
     527        response = toResponse(iq, u'result')
     528        query = response.addElement((NS_DISCO_ITEMS, u'query'))
     529        self.stub.send(response)
     530
     531        return d
     532
     533
    517534    def test_requestInfo(self):
    518535        """
     
    550567
    551568        self.stub.send(response)
     569        return d
     570
     571
     572    def test_requestInfoFrom(self):
     573        """
     574        A disco info request can be sent with an explicit sender address.
     575        """
     576        d = self.protocol.requestInfo(JID(u'example.org'),
     577                                       sender=JID(u'test.example.org'))
     578
     579        iq = self.stub.output[-1]
     580        print iq.toXml()
     581        self.assertEqual(u'test.example.org', iq.getAttribute(u'from'))
     582
     583        response = toResponse(iq, u'result')
     584        query = response.addElement((NS_DISCO_INFO, u'query'))
     585        self.stub.send(response)
     586
    552587        return d
    553588
Note: See TracChangeset for help on using the changeset viewer.