| Server IP : 61.19.30.66 / Your IP : 216.73.216.15 Web Server : Apache/2.2.22 (Ubuntu) System : Linux klw 3.11.0-15-generic #25~precise1-Ubuntu SMP Thu Jan 30 17:39:31 UTC 2014 x86_64 User : www-data ( 33) PHP Version : 5.3.10-1ubuntu3.48 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority, MySQL : ON | cURL : OFF | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : OFF Directory : /usr/lib/python2.7/dist-packages/twisted/application/test/ |
Upload File : |
ó
ê=Nc @ sâ d Z d d l m Z d d l m Z d d l m Z d d l m Z d d l m
Z
d d l m Z m
Z
d d l m Z m Z d e f d
„ ƒ YZ e e e ƒ d e f d „ ƒ YZ e e e ƒ d
e f d „ ƒ YZ d S( s:
Tests for (new code in) L{twisted.application.internet}.
iÿÿÿÿ( t
implements( t verifyClass( t Factory( t TestCase( t StreamServerEndpointService( t IStreamServerEndpointt IListeningPort( t Deferredt CancelledErrort
FakeServerc B s] e Z d Z e e ƒ d Z d Z d Z e ƒ Z
d Z d „ Z d „ Z
d „ Z d „ Z RS( sq
In-memory implementation of L{IStreamServerEndpoint}.
@ivar result: The L{Deferred} resulting from the call to C{listen}, after
C{listen} has been called.
@ivar factory: The factory passed to C{listen}.
@ivar cancelException: The exception to errback C{self.result} when it is
cancelled.
@ivar port: The L{IListeningPort} which C{listen}'s L{Deferred} will fire
with.
@ivar listenAttempts: The number of times C{listen} has been invoked.
@ivar failImmediately: If set, the exception to fail the L{Deferred}
returned from C{listen} before it is returned.
i c C s t ƒ | _ d S( N( t FakePortt port( t self( ( sJ /usr/lib/python2.7/dist-packages/twisted/application/test/test_internet.pyt __init__/ s c s_ ˆ j d 7_ | ˆ _ t d ‡ f d † ƒ ˆ _ ˆ j d k rX ˆ j j ˆ j ƒ n ˆ j S( sw
Return a Deferred and store it for future use. (Implementation of
L{IStreamServerEndpoint}).
i t cancellerc s | j ˆ j ƒ S( N( t errbackt cancelException( t d( R ( sJ /usr/lib/python2.7/dist-packages/twisted/application/test/test_internet.pyt <lambda>; s N( t listenAttemptst factoryR t resultt failImmediatelyt NoneR ( R R ( ( R sJ /usr/lib/python2.7/dist-packages/twisted/application/test/test_internet.pyt listen3 s c C s | j j | j ƒ d S( s°
Test code should invoke this method after causing C{listen} to be
invoked in order to fire the L{Deferred} previously returned from
C{listen}.
N( R t callbackR ( R ( ( sJ /usr/lib/python2.7/dist-packages/twisted/application/test/test_internet.pyt startedListeningA s c C s | j j j d ƒ d S( s
Test code should invoke this method after causing C{stopListening} to
be invoked on the port fired from the L{Deferred} returned from
C{listen} in order to cause the L{Deferred} returned from
C{stopListening} to fire.
N( R t deferredR R ( R ( ( sJ /usr/lib/python2.7/dist-packages/twisted/application/test/test_internet.pyt stoppedListeningJ s N( t __name__t
__module__t __doc__R R R R R R R R R R
R R R ( ( ( sJ /usr/lib/python2.7/dist-packages/twisted/application/test/test_internet.pyR s
R
c B s' e Z d Z e e ƒ d Z d „ Z RS( ss
Fake L{IListeningPort} implementation.
@ivar deferred: The L{Deferred} returned by C{stopListening}.
c C s t ƒ | _ | j S( N( R R ( R ( ( sJ /usr/lib/python2.7/dist-packages/twisted/application/test/test_internet.pyt
stopListeningb s N( R R R R R R R R ( ( ( sJ /usr/lib/python2.7/dist-packages/twisted/application/test/test_internet.pyR
W s
t TestEndpointServicec B st e Z d Z d „ Z d „ Z d d „ Z d „ Z d „ Z d „ Z d „ Z
d „ Z d „ Z d
„ Z
d „ Z RS(
s4
Tests for L{twisted.application.internet}.
c C s4 t ƒ | _ t ƒ | _ t | j | j ƒ | _ d S( sp
Construct a stub server, a stub factory, and a
L{StreamServerEndpointService} to test.
N( R t
fakeServerR R R t svc( R ( ( sJ /usr/lib/python2.7/dist-packages/twisted/application/test/test_internet.pyt setUpo s c C s* | j j ƒ | j | j | j j ƒ d S( s‡
L{StreamServerEndpointService.privilegedStartService} calls its
endpoint's C{listen} method with its factory.
N( R# t privilegedStartServicet assertIdenticalR R"