+
    Dfjv                     \    R t ^ RIt^ RIHt ^ RIHtHt ^ RIHt ^ RI	H
t
  ! R R]
4      tR# )z6
Test that twisted scripts can be invoked as modules.
N)StringIO)deferreactor)Accumulator)TestCasec                   6   a  ] tR t^t o RtR tR tR tRtV t	R# )	MainTestsz4Test that twisted scripts can be invoked as modules.c                b  a a \         P                  p\        4       o\        P                  ! 4       ;pSn        \        P                  ! SWRRR.RR7       SP                  P                  4        ^ RI
Hp S P                  \         RVP                  R.4       VV 3R lpVP                  V4      # )	z0Invoking python -m twisted should execute twist.-mtwisted--helpNenv__main__argvc                 j   < SP                   pVP                  4       pSP                  R V9   V4       R# )s,   -m twisted [options] plugin [plugin_options]NoutFgetvalue
assertTrueignfoutputpselfs   &  8/usr/lib/python3/dist-packages/twisted/test/test_main.pyprocessEnded,MainTests.test_twisted.<locals>.processEnded!   s-    AZZ\FOO?6I6    )sys
executabler   r   DeferredendedDeferredr   spawnProcess	transport
closeStdinr   r   patch__file__addCallbackr   cmddr   r   r   s   f    @r   test_twistedMainTests.test_twisted   s    nnM#nn..AOQ4H%E4P	  	%

3!2!2H =>	 }}\**r    c                b  a a \         P                  p\        4       o\        P                  ! 4       ;pSn        \        P                  ! SWRRR.RR7       SP                  P                  4        ^ RI
Hp S P                  \         RVP                  R.4       VV 3R lpVP                  V4      # )	z6Invoking python -m twisted.trial should execute trial.r
   ztwisted.trialr   Nr   r   r   c                 j   < SP                   pVP                  4       pSP                  R V9   V4       R# )s   -j, --jobs= Nr   r   s   &  r   r   *MainTests.test_trial.<locals>.processEnded8   s*    AZZ\FOOOv5v>r    )r!   r"   r   r   r#   r$   r   r%   r&   r'   twisted.trialr   r(   r)   r*   r+   s   f    @r   
test_trialMainTests.test_trial+   s    nnM#nn..AOQ4(%KQUV	  	+

3!2!2H =>	? }}\**r    c                    \        4       pV P                  \        RV4      p^ RIpV P	                  VP
                  4       VP                  4        V P                  VP                  4       R4       R# )z2Importing twisted.__main__ does not execute twist.stdoutN )	r   r(   r!   twisted.__main__r   r   restoreassertEqualr   )r   r   monkeyr   s   &   r   test_twisted_importMainTests.test_twisted_import@   sQ    C62(()*B/r     N)
__name__
__module____qualname____firstlineno____doc__r.   r4   r=   __static_attributes____classdictcell__)__classdict__s   @r   r   r      s     >+.+*
0 
0r    r   )rD   r!   ior   twisted.internetr   r   twisted.test.test_processr   twisted.trial.unittestr   r   r?   r    r   <module>rL      s'   
   + 1 +90 90r    