Changeset 79:0752a1cca356 in ralphm-patches for server-stream-manager.patch


Ignore:
Timestamp:
Jun 22, 2016, 4:43:00 PM (4 years ago)
Author:
Ralph Meijer <ralphm@…>
Branch:
default
Message:

Split out stanza module and response tracking patches, fix other patches.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • server-stream-manager.patch

    r72 r79  
    11# HG changeset patch
    22# Parent 3f3fe954b1975c2d9115e0fa8177ae7b28a708a8
     3# Parent  e198cebf36146a768eda902efa5ee741e947fda8
    34Generalize StreamManager and add ServerStreamManager.
    45
     
    3536--- a/wokkel/subprotocols.py
    3637+++ b/wokkel/subprotocols.py
    37 @@ -118,7 +118,7 @@
     38@@ -122,7 +122,7 @@
    3839 
    3940 
     
    4445     Business logic representing a managed XMPP connection.
    4546 
    46 @@ -129,43 +129,39 @@
     47@@ -133,43 +133,39 @@
    4748 
    4849     @ivar xmlstream: currently managed XML stream
     
    9596             from twisted.internet import reactor
    9697         self._reactor = reactor
    97 @@ -191,7 +187,7 @@
     98@@ -195,7 +191,7 @@
    9899             handler.connectionInitialized()
    99100 
     
    104105         Called when the transport connection has been established.
    105106 
    106 @@ -209,13 +205,17 @@
     107@@ -213,13 +209,17 @@
    107108             xs.rawDataInFn = logDataIn
    108109             xs.rawDataOutFn = logDataOut
     
    123124         Called when the stream has been initialized.
    124125 
    125 @@ -238,21 +238,8 @@
     126@@ -242,21 +242,8 @@
    126127             e.connectionInitialized()
    127128 
     
    146147         Called when the stream has been closed.
    147148 
    148 @@ -379,6 +366,60 @@
     149@@ -468,6 +455,60 @@
    149150 
    150151 
     
    233234--- a/wokkel/test/test_subprotocols.py
    234235+++ b/wokkel/test/test_subprotocols.py
    235 @@ -189,20 +189,7 @@
     236@@ -190,22 +190,7 @@
    236237 
    237238 
     
    250251-        self.xmlstream.transport = self.transport
    251252-
    252 -        self.request = IQGetStanza()
     253-        self.request = IQGetStanza(recipient=JID('other@example.org'),
     254-                                   sender=JID('user@example.org'))
     255-
    253256+class BaseStreamManagerTestsMixin(object):
    254257 
    255258     def _streamStarted(self):
    256259         """
    257 @@ -216,25 +203,14 @@
     260@@ -219,25 +204,14 @@
    258261         self.xmlstream.dispatch(self.xmlstream, "//event/stream/authd")
    259262 
     
    285288         Test that protocol handlers have their connectionMade method called
    286289         when the XML stream is connected.
    287 @@ -242,27 +218,27 @@
     290@@ -245,27 +219,27 @@
    288291         sm = self.streamManager
    289292         handler = DummyXMPPHandler()
     
    319322         Test raw data functions set when logTraffic is set to True.
    320323         """
    321 @@ -270,13 +246,13 @@
     324@@ -273,13 +247,13 @@
    322325         sm.logTraffic = True
    323326         handler = DummyXMPPHandler()
     
    336339         Test that protocol handlers have their connectionInitialized method
    337340         called when the XML stream is initialized.
    338 @@ -284,27 +260,27 @@
     341@@ -287,27 +261,27 @@
    339342         sm = self.streamManager
    340343         handler = DummyXMPPHandler()
     
    369372         A L{STREAM_END_EVENT} results in L{StreamManager} firing the handlers
    370373         L{connectionLost} methods, passing a L{failure.Failure} reason.
    371 @@ -313,7 +289,7 @@
     374@@ -316,7 +290,7 @@
    372375         handler = FailureReasonXMPPHandler()
    373376         handler.setHandlerParent(sm)
     
    378381 
    379382 
    380 @@ -335,8 +311,8 @@
     383@@ -338,8 +312,8 @@
    381384         Adding a handler when connected doesn't call connectionInitialized.
    382385         """
     
    389392         handler.setHandlerParent(sm)
    390393 
    391 @@ -358,10 +334,10 @@
     394@@ -361,10 +335,10 @@
    392395                 self.nestedHandler.setHandlerParent(self.parent)
    393396 
     
    402405         self.assertEquals(1, handler.doneMade)
    403406         self.assertEquals(0, handler.doneInitialized)
    404 @@ -383,9 +359,9 @@
     407@@ -386,9 +360,9 @@
    405408         called.
    406409         """
     
    415418         handler.setHandlerParent(sm)
    416419 
    417 @@ -407,11 +383,11 @@
     420@@ -410,11 +384,11 @@
    418421                 self.nestedHandler.setHandlerParent(self.parent)
    419422 
     
    430433         self.assertEquals(1, handler.doneMade)
    431434         self.assertEquals(1, handler.doneInitialized)
    432 @@ -435,12 +411,12 @@
     435@@ -438,12 +412,12 @@
    433436                 self.nestedHandler.setHandlerParent(self.parent)
    434437 
     
    447450         self.assertEquals(1, handler.doneMade)
    448451         self.assertEquals(1, handler.doneInitialized)
    449 @@ -470,16 +446,13 @@
     452@@ -473,16 +447,13 @@
    450453 
    451454         The data should be sent directly over the XML stream.
     
    466469 
    467470 
    468 @@ -490,12 +463,11 @@
     471@@ -493,12 +464,11 @@
    469472         The data should be cached until an XML stream has been established and
    470473         initialized.
     
    481484         sm.send("<presence/>")
    482485         self.assertEquals("", xs.transport.value())
    483 @@ -522,7 +494,7 @@
     486@@ -525,7 +495,7 @@
    484487         """
    485488         factory = xmlstream.XmlStreamFactory(xmlstream.Authenticator())
     
    490493         xs.connectionMade()
    491494         xs.dataReceived("<stream:stream xmlns='jabber:client' "
    492 @@ -545,7 +517,7 @@
     495@@ -548,7 +518,7 @@
    493496         handler = DummyXMPPHandler()
    494497         sm.addHandler(handler)
     
    499502         xs.transport = proto_helpers.StringTransport()
    500503         xs.connectionLost(None)
    501 @@ -677,6 +649,7 @@
     504@@ -720,6 +690,7 @@
    502505         """
    503506         d = self.streamManager.request(self.request)
     
    507510         self.assertFailure(d, ConnectionDone)
    508511         return d
    509 @@ -692,6 +665,7 @@
     512@@ -735,6 +706,7 @@
    510513             d = xmlstream.IQ(self.xmlstream).send()
    511514             d.addErrback(eb)
     
    515518         d.addErrback(eb)
    516519         self.xmlstream.connectionLost(failure.Failure(ConnectionDone()))
    517 @@ -736,6 +710,7 @@
     520@@ -780,6 +752,7 @@
    518521         self.request.timeout = 60
    519522         d = self.streamManager.request(self.request)
     
    523526         self.assertFailure(d, ConnectionDone)
    524527         self.assertFalse(self.clock.calls)
    525 @@ -778,6 +753,56 @@
     528@@ -822,6 +795,58 @@
    526529 
    527530 
     
    540543+        self.xmlstream.transport = self.transport
    541544+
    542 +        self.request = IQGetStanza()
     545+        self.request = IQGetStanza(recipient=JID('other@example.org'),
     546+                                   sender=JID('user@example.org'))
    543547+
    544548+
     
    573577+                                   self.streamManager.makeConnection)
    574578+
    575 +        self.request = IQGetStanza()
     579+        self.request = IQGetStanza(recipient=JID('other@example.org'),
     580+                                   sender=JID('user@example.org'))
    576581+
    577582+
Note: See TracChangeset for help on using the changeset viewer.