Ignore:
Timestamp:
Dec 26, 2008, 2:40:11 PM (14 years ago)
Author:
Ralph Meijer <ralphm@…>
Branch:
default
Convert:
svn:b33ecbfc-034c-dc11-8662-000475d9059e/trunk@140
Message:

If provided, return NodeID in the response for Service Discovery requests.

This also renames the namespace constants to include DISCO in their name
and provides better tests and docstrings.

Author: ralphm.
Reviewer: tofu.
Fixes #7.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • wokkel/test/test_pubsub.py

    r43 r46  
    1010from twisted.trial import unittest
    1111from twisted.internet import defer
    12 from twisted.words.xish import domish, xpath
     12from twisted.words.xish import domish
    1313from twisted.words.protocols.jabber import error
    1414from twisted.words.protocols.jabber.jid import JID
    1515
    1616from wokkel import data_form, iwokkel, pubsub, shim
    17 from wokkel.generic import parseXml
    18 from wokkel.test.helpers import XmlStreamStub
     17from wokkel.test.helpers import TestableRequestHandlerMixin, XmlStreamStub
    1918
    2019try:
     
    492491
    493492
    494 class PubSubServiceTest(unittest.TestCase):
     493class PubSubServiceTest(unittest.TestCase, TestableRequestHandlerMixin):
    495494    """
    496495    Tests for L{pubsub.PubSubService}.
     
    501500        self.service = pubsub.PubSubService()
    502501        self.service.send = self.stub.xmlstream.send
    503 
    504     def handleRequest(self, xml):
    505         """
    506         Find a handler and call it directly
    507         """
    508         handler = None
    509         iq = parseXml(xml)
    510         for queryString, method in self.service.iqHandlers.iteritems():
    511             if xpath.internQuery(queryString).matches(iq):
    512                 handler = getattr(self.service, method)
    513 
    514         if handler:
    515             d = defer.maybeDeferred(handler, iq)
    516         else:
    517             d = defer.fail(NotImplementedError())
    518 
    519         return d
    520 
    521502
    522503    def test_interface(self):
Note: See TracChangeset for help on using the changeset viewer.