AnonSec Shell
Server IP : 209.38.156.173  /  Your IP : 216.73.216.122   [ Reverse IP ]
Web Server : Apache/2.4.52 (Ubuntu)
System : Linux lakekumayuhotel 5.15.0-136-generic #147-Ubuntu SMP Sat Mar 15 15:53:30 UTC 2025 x86_64
User : root ( 0)
PHP Version : 8.1.2-1ubuntu2.22
Disable Function : NONE
Domains : 2 Domains
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /usr/lib/python3/dist-packages/twisted/test/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME ]     [ BACKUP SHELL ]     [ JUMPING ]     [ MASS DEFACE ]     [ SCAN ROOT ]     [ SYMLINK ]     

Current File : /usr/lib/python3/dist-packages/twisted/test/__pycache__/test_randbytes.cpython-310.pyc
o

�b��@sjdZddlmZddlmZGdd�d�ZGdd�deej�ZGdd	�d	eej�Z	Gd
d�deej�Z
dS)
z-
Test cases for L{twisted.python.randbytes}.
�)�	randbytes)�unittestc@�eZdZdZdd�ZdS)�SecureRandomTestCaseBasez1
    Base class for secureRandom test cases.
    cCsPtdd�D] }||�}|�t|�|�||�}|�t|�|�|�||�qdS)a|
        The given random bytes source should return the number of bytes
        requested each time it is called and should probably not return the
        same bytes on two consecutive calls (although this is a perfectly
        legitimate occurrence and rejecting it may generate a spurious failure
        -- maybe we'll get lucky and the heat death with come first).
        ��N)�range�assertEqual�len�assertNotEqual)�self�source�nbytes�s�s2�r�=/usr/lib/python3/dist-packages/twisted/test/test_randbytes.py�_checks�zSecureRandomTestCaseBase._checkN)�__name__�
__module__�__qualname__�__doc__rrrrrr
�rc@r)�SecureRandomTestsz4
    Test secureRandom under normal conditions.
    cC�|�tj�dS)z�
        L{randbytes.secureRandom} should return a string of the requested
        length and make some effort to make its result otherwise unpredictable.
        N)rr�secureRandom�rrrr�test_normal(szSecureRandomTests.test_normalN)rrrrrrrrrr#rrc@s0eZdZdZdd�Zdd�Zdd�Zdd	�Zd
S)�ConditionalSecureRandomTestsz<
    Test random sources one by one, then remove it to.
    cCst��|_dS)zJ
        Create a L{randbytes.RandomFactory} to use in the tests.
        N)r�
RandomFactory�factoryrrrr�setUp7sz"ConditionalSecureRandomTests.setUpcCst���)zL
        A factory raising an error when a source is not available.
        )r�SourceNotAvailable)rrrrr�errorFactory=sz)ConditionalSecureRandomTests.errorFactorycCs|�|jj�dS)zy
        L{RandomFactory._osUrandom} should work as a random source whenever
        L{os.urandom} is available.
        N)rr �
_osUrandomrrrr�test_osUrandomCsz+ConditionalSecureRandomTests.test_osUrandomcsN�j�j_��tj�jjd��fdd�}��tdt	|�}��
t|�d�dS)zt
        Remove all secure sources and assert it raises a failure. Then try the
        fallback parameter.
        �cs�jjddd�S)Nr&T)�fallback)r rrrrr�wrapperTszBConditionalSecureRandomTests.test_withoutAnything.<locals>.wrapperzPurandom unavailable - proceeding with non-cryptographically secure random sourceN)r#r r$�assertRaisesr�SecureRandomNotAvailabler�assertWarns�RuntimeWarning�__file__r	r
)rr(rrrr�test_withoutAnythingJs
��z1ConditionalSecureRandomTests.test_withoutAnythingN)rrrrr!r#r%r.rrrrr0src@s eZdZdZdd�Zdd�ZdS)�RandomBaseTestsz%
    'Normal' random test cases.
    cCr)z"
        Test basic case.
        N)rr�insecureRandomrrrrrfszRandomBaseTests.test_normalcCst��}d|_|�|j�dS)zG
        Test C{insecureRandom} without C{random.getrandbits}.
        N)rr�getrandbitsrr0)rr rrr�test_withoutGetrandbitslsz'RandomBaseTests.test_withoutGetrandbitsN)rrrrrr2rrrrr/asr/N)r�twisted.pythonr�
twisted.trialrr�TestCaser�SynchronousTestCaserr/rrrr�<module>s

�1

Anon7 - 2022
AnonSec Team