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/hyperlink/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/hyperlink/test/__pycache__/test_hypothesis.cpython-310.pyc
o

�(_��@sdZzddlZ[Wn
eyYdSwddlmZddlmZmZzddlm	Z	Wney9ddl
m	Z	YnwddlmZmZddl
mZmZddlmZmZmZd	d
lmZddlmZmZdd
lmZmZmZmZmZmZm Z m!Z!m"Z"Gdd�de�Z#dS)z!
Tests for hyperlink.hypothesis.
�N)�digits)�Sequence�Text)�patch)�given�settings)�SearchStrategy�data)�	IDNAError�check_label�encode�)�HyperlinkTestCase�)�
DecodedURL�
EncodedURL)	�DrawCallable�	composite�decoded_urls�encoded_urls�hostname_labels�	hostnames�	idna_text�paths�port_numbersc@s,eZdZdZee��dd��Zee��dd��Zee	��dd��Z
ee	dd	��d
d��Zee��dd
��Z
ee��edd�dd���Zeedd��dd��Zee��dd��Zeedd��dd��Zeedd��dd��Zeeddd��dd��Zee��d d!��Zee��d"d#��Zee��d$d%��Zd&S)'�TestHypothesisStrategiesz1
        Tests for hyperlink.hypothesis.
        cCs,zt|�WdStytd�|���w)zD
            idna_text() generates IDNA-encodable text.
            zInvalid IDNA text: {!r}N)�idna_encoder
�AssertionError�format)�self�text�r!�@/usr/lib/python3/dist-packages/hyperlink/test/test_hypothesis.py�test_idna_text_valid-s
�z-TestHypothesisStrategies.test_idna_text_validcCs0|�t|jtdd��|�t|jtdd��dS)zO
            idna_text() raises AssertionError if min_size is < 1.
            r)�min_size)�max_sizeN)�assertRaisesr�drawr)rr	r!r!r"�test_idna_text_min_max8sz/TestHypothesisStrategies.test_idna_text_min_maxcC�|�|d�|�|d�dS)z[
            port_numbers() generates integers between 1 and 65535, inclusive.
            r
�N��assertGreaterEqual�assertLessEqual�r�portr!r!r"�test_port_numbers_boundsAsz1TestHypothesisStrategies.test_port_numbers_boundsT)�
allow_zerocCr))zv
            port_numbers(allow_zero=True) generates integers between 0 and
            65535, inclusive.
            rr*Nr+r.r!r!r"�#test_port_numbers_bounds_allow_zeroJsz<TestHypothesisStrategies.test_port_numbers_bounds_allow_zerocCs4zt|�t|�WdStytd�|���w)zK
            hostname_labels() generates IDN host name labels.
            �Invalid IDN label: {!r}N)rr�UnicodeErrorrr�r�labelr!r!r"�test_hostname_labels_valid_idnTs�z7TestHypothesisStrategies.test_hostname_labels_valid_idn�
)�max_examplesc	Csztdd��}td|��(|�t��}z
t|�t|�Wnty*td�|���wWd�dS1s6wYdS)z�
            hostname_labels() handles case where idna_text() generates text
            that encoded to punycode ends up as longer than allowed.
            cSsd|S)N�ár!)r'r$r%r!r!r"�mock_idna_textiszWTestHypothesisStrategies.test_hostname_labels_long_idn_punycode.<locals>.mock_idna_textzhyperlink.hypothesis.idna_textr3N)	rrr'rrrr4rr)rr	r;r6r!r!r"�&test_hostname_labels_long_idn_punycode`s	
	���"�z?TestHypothesisStrategies.test_hostname_labels_long_idn_punycodeF)�	allow_idncCs6zt|�|�d�WdStytd�|���w)zO
            hostname_labels() generates a ASCII host name labels.
            �asciizInvalid ASCII label: {!r}N)rrr4rrr5r!r!r"� test_hostname_labels_valid_ascii}s�z9TestHypothesisStrategies.test_hostname_labels_valid_asciicCsDz|�d�D]}t|�qt|�WdSty!td�|���w)zA
            hostnames() generates a IDN host names.
            �.zInvalid IDN host name: {!r}N)�splitrrr4rr�r�hostnamer6r!r!r"�test_hostnames_idn�s
��z+TestHypothesisStrategies.test_hostnames_idn)�allow_leading_digitcC�|�||�t�k�dS)z}
            hostnames(allow_leading_digit=False) generates a IDN host names
            without leading digits.
            N��
assertTrue�lstripr�rrCr!r!r"�test_hostnames_idn_nolead��z2TestHypothesisStrategies.test_hostnames_idn_noleadcCsFz|�d�D]}t|�q|�d�WdSty"td�|���w)zC
            hostnames() generates a ASCII host names.
            r@r>zInvalid ASCII host name: {!r}N)rArrr4rrrBr!r!r"�test_hostnames_ascii�s
��z-TestHypothesisStrategies.test_hostnames_ascii)rEr=cCrF)z�
            hostnames(allow_leading_digit=False, allow_idn=False) generates
            ASCII host names without leading digits.
            NrGrJr!r!r"�test_hostnames_ascii_nolead�rLz4TestHypothesisStrategies.test_hostnames_ascii_noleadcCsPd�|�}z|�d�Wntytd�|���w|D]}|�d|�qdS)zM
            paths() generates sequences of URL path components.
            �/zutf-8zInvalid URL path: {!r}z#/?N)�joinrr4rr�assertNotIn)r�pathr �segmentr!r!r"�
test_paths�s
��z#TestHypothesisStrategies.test_pathscC�|�|t�dS)z?
            encoded_urls() generates EncodedURLs.
            N)�assertIsInstancer�r�urlr!r!r"�test_encoded_urls��z*TestHypothesisStrategies.test_encoded_urlscCrU)z?
            decoded_urls() generates DecodedURLs.
            N)rVrrWr!r!r"�test_decoded_urls�rZz*TestHypothesisStrategies.test_decoded_urlsN)�__name__�
__module__�__qualname__�__doc__rrr#r	r(rr0r2rr7rr<r?rrDrKrMrNrrTrrYrr[r!r!r!r"r(s>




	







r)$r_�
hypothesis�ImportError�stringr�typingrr�
unittest.mockr�mockrr�hypothesis.strategiesrr	�idnar
rrr�commonr�rrrrrrrrrrrrr!r!r!r"�<module>s*��,

Anon7 - 2022
AnonSec Team