__  __    __   __  _____      _            _          _____ _          _ _ 
 |  \/  |   \ \ / / |  __ \    (_)          | |        / ____| |        | | |
 | \  / |_ __\ V /  | |__) | __ ___   ____ _| |_ ___  | (___ | |__   ___| | |
 | |\/| | '__|> <   |  ___/ '__| \ \ / / _` | __/ _ \  \___ \| '_ \ / _ \ | |
 | |  | | |_ / . \  | |   | |  | |\ V / (_| | ||  __/  ____) | | | |  __/ | |
 |_|  |_|_(_)_/ \_\ |_|   |_|  |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1
 if you need WebShell for Seo everyday contact me on Telegram
 Telegram Address : @jackleet
        
        
For_More_Tools: Telegram: @jackleet | Bulk Smtp support mail sender | Business Mail Collector | Mail Bouncer All Mail | Bulk Office Mail Validator | Html Letter private



Upload:

Command:

aptanhua@216.73.217.122: ~ $
�

Y��g���d�dZddlZddlmZmZddlmZmZgd�Zda	d�Z
e
�\ZZd�Z
d	d�Zy)
av
Twisted integration
-------------------

This module provides a very simple way to integrate your tests with the
Twisted_ event loop.

You must import this module *before* importing anything from Twisted itself!

Example::

  from nose.twistedtools import reactor, deferred
  
  @deferred()
  def test_resolve():
      return reactor.resolve("www.python.org")

Or, more realistically::

  @deferred(timeout=5.0)
  def test_resolve():
      d = reactor.resolve("www.python.org")
      def check_ip(ip):
          assert ip == "67.15.36.43"
      d.addCallback(check_ip)
      return d

.. _Twisted: http://twistedmatrix.com/trac/
�N)�Queue�Empty)�make_decorator�TimeExpired)�threaded_reactor�reactor�deferredr�stop_reactorc����	ddlm�tsAddlm}ddlm}|�fd���atjd�tj��tfS#t$rYywxYw)	z�
    Start the Twisted reactor in a separate thread, if not already done.
    Returns the reactor.
    The thread will automatically be destroyed when all the tests are done.
    r�r)NN)�
threadable)�Threadc�(���jd��S)NF)�installSignalHandlers)�runrs��@/opt/hc_python/lib/python3.12/site-packages/nose/twistedtools.py�<lambda>z"threaded_reactor.<locals>.<lambda>8s������&+�1<�1-�)�targetT)
�twisted.internetr�ImportError�_twisted_thread�twisted.pythonr
�	threadingr�	setDaemon�start)r
rrs  @rrr*s^����,��-�$� �)-�.���!�!�$�'������O�#�#������s�A�	A$�#A$c���d�}tj|�tj�tj	�D]#}|j�s�|j
��%day)aStop the reactor and join the reactor thread until it stops.
    Call this function in teardown at the module or package level to
    reset the twisted system after your tests. You *must* do this if
    you mix tests using these tools and tests using twisted.trial.
    c�,�tj�y)z0Helper for calling stop from withing the thread.N)r�stop�rrr
z"stop_reactor.<locals>.stop_reactorJs�����rN)r�callFromThread�reactor_thread�join�getDelayedCalls�active�cancelr)r
�ps  rr
r
BsO������<�(�����
�
$�
$�
&���8�8�:�
�H�H�J�'��Orc����t�\�}��td��	�duxs�dz��fd�}|S#t$rtd��wxYw)a
    By wrapping a test function with this decorator, you can return a
    twisted Deferred and the test will wait for the deferred to be triggered.
    The whole test function will run inside the Twisted event loop.

    The optional timeout parameter specifies the maximum duration of the test.
    The difference with timed() is that timed() will still wait for the test
    to end, while deferred() will stop the test when its timeout has expired.
    The latter is more desireable when dealing with network tests, because
    the result may actually never arrive.

    If the callback is triggered, the test has passed.
    If the errback is triggered or the timeout expires, the test has failed.

    Example::
    
        @deferred(timeout=5.0)
        def test_resolve():
            return reactor.resolve("www.python.org")

    Attention! If you combine this decorator with other decorators (like
    "raises"), deferred() must be called *first*!

    In other words, this is good::
        
        @raises(DNSLookupError)
        @deferred()
        def test_error():
            return reactor.resolve("xxxjhjhj.biz")

    and this is bad::
        
        @deferred()
        @raises(DNSLookupError)
        def test_error():
            return reactor.resolve("xxxjhjhj.biz")
    Nz1twisted is not available or could not be importedrz+'timeout' argument must be a number or Nonec�:������fd�}t��|�}|S)Nc�������	�t��	�	fd���	fd������
��	fd�}�j|�	�	j���}|�|\}}}||�j|��y#t$rt	d�z��wxYw)Nc�(���jd�y�N)�put)�value�qs �r�callbackz=deferred.<locals>.decorate.<locals>.wrapper.<locals>.callback�s������d�rc�|��	|j�y#�jtj��YyxYwr,)�raiseExceptionr-�sys�exc_info)�failurer/s �r�errbackz<deferred.<locals>.decorate.<locals>.wrapper.<locals>.errback�s-���*��*�*�,��*��E�E�#�,�,�.�)�s��%;c����	��i���}	|j���y#t$rtd��wxYw#�jt	j
��YyxYw)Nz7you must return a twisted Deferred from your test case!)�addCallbacks�AttributeError�	TypeErrorr-r3r4)�d�argsr0r6�func�kargsr/s ������r�gz6deferred.<locals>.decorate.<locals>.wrapper.<locals>.g�sj���*��d�,�e�,�A�@����x��9��*�@�'�)?�@�@�@��
*��E�E�#�,�,�.�)�s�7��4�7�%A)�timeoutz*timeout expired before end of test (%f s.))rr!�getrr�with_traceback)
r<r>r?�error�exc_type�	exc_value�tbr0r6r/r=rr@s
``     @@@���r�wrapperz+deferred.<locals>.decorate.<locals>.wrapper�s������A�
�
*�

*�

*�
�"�"�1�%�
-����g��.��
� �*/�'��)�R��y�)�8�8��<�<�!��	�
-�!�"N�$+�#,�-�-�
-�s�A)�)B)r)r=rGrr@s` ��r�decoratezdeferred.<locals>.decorate�s!���!	=�D'�.��&�w�/���r)rrr:)r@r"rHrs`  @rr	r	Vsh���L/�0��G�^����M�N�N�G��4��&�7�Q�;��$�J�O��Q�G��E�F�F�G�s	�1�Ar,)�__doc__r3�queuerr�
nose.toolsrr�__all__rrrr"r
r	r rr�<module>rMsB���<��2���
��$�*+�,�����(Vr

Filemanager

Name Type Size Permission Actions
__init__.cpython-312.pyc File 634 B 0644
__main__.cpython-312.pyc File 450 B 0644
case.cpython-312.pyc File 16.52 KB 0644
commands.cpython-312.pyc File 7.2 KB 0644
config.cpython-312.pyc File 30.73 KB 0644
core.cpython-312.pyc File 16.78 KB 0644
exc.cpython-312.pyc File 572 B 0644
failure.cpython-312.pyc File 2.29 KB 0644
importer.cpython-312.pyc File 7.76 KB 0644
inspector.cpython-312.pyc File 8.42 KB 0644
loader.cpython-312.pyc File 26.48 KB 0644
proxy.cpython-312.pyc File 10.12 KB 0644
pyversion.cpython-312.pyc File 9.99 KB 0644
result.cpython-312.pyc File 8.92 KB 0644
selector.cpython-312.pyc File 11.74 KB 0644
suite.cpython-312.pyc File 27.26 KB 0644
twistedtools.cpython-312.pyc File 6.74 KB 0644
util.cpython-312.pyc File 27.33 KB 0644