Ignore:
Timestamp:
Oct 10, 2008, 5:24:28 PM (14 years ago)
Author:
Ralph Meijer <ralphm@…>
Branch:
default
Convert:
svn:b33ecbfc-034c-dc11-8662-000475d9059e/trunk@90
Message:

Add XMPP router and server side component authenticator.

Author: ralphm.
Fixed #30.

Location:
wokkel/test
Files:
1 added
1 edited

Legend:

Unmodified
Added
Removed
  • wokkel/test/test_generic.py

    r20 r35  
    4949        self.assertEquals(1, len(elements))
    5050        self.assertEquals('0.1.0', unicode(elements[0]))
     51
     52
     53
     54class XmlPipeTest(unittest.TestCase):
     55    """
     56    Tests for L{wokkel.generic.XmlPipe}.
     57    """
     58
     59    def setUp(self):
     60        self.pipe = generic.XmlPipe()
     61
     62
     63    def test_sendFromSource(self):
     64        """
     65        Send an element from the source and observe it from the sink.
     66        """
     67        def cb(obj):
     68            called.append(obj)
     69
     70        called = []
     71        self.pipe.sink.addObserver('/test[@xmlns="testns"]', cb)
     72        element = domish.Element(('testns', 'test'))
     73        self.pipe.source.send(element)
     74        self.assertEquals([element], called)
     75
     76
     77    def test_sendFromSink(self):
     78        """
     79        Send an element from the sink and observe it from the source.
     80        """
     81        def cb(obj):
     82            called.append(obj)
     83
     84        called = []
     85        self.pipe.source.addObserver('/test[@xmlns="testns"]', cb)
     86        element = domish.Element(('testns', 'test'))
     87        self.pipe.sink.send(element)
     88        self.assertEquals([element], called)
Note: See TracChangeset for help on using the changeset viewer.