§
    T¦·fç  ã                   ó  — d Z 	 ddlZ[ddlmZ ddlmZmZ 	 ddlmZ n# e	$ r	 ddl
mZ Y nw xY wddlmZmZ ddlmZmZ ddlmZmZmZ d	d
lmZ ddlmZmZ ddlmZmZmZmZmZmZm Z m!Z!m"Z"  G d„ de¦  «        Z#dS # e	$ r Y dS w xY w)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                   ó\  — e Zd ZdZ e e¦   «         ¦  «        d„ ¦   «         Z e e¦   «         ¦  «        d„ ¦   «         Z e e	¦   «         ¦  «        d„ ¦   «         Z
 e e	d¬¦  «        ¦  «        d„ ¦   «         Z e e¦   «         ¦  «        d„ ¦   «         Z e e¦   «         ¦  «         ed	¬
¦  «        d„ ¦   «         ¦   «         Z e ed¬¦  «        ¦  «        d„ ¦   «         Z e e¦   «         ¦  «        d„ ¦   «         Z e ed¬¦  «        ¦  «        d„ ¦   «         Z e ed¬¦  «        ¦  «        d„ ¦   «         Z e edd¬¦  «        ¦  «        d„ ¦   «         Z e e¦   «         ¦  «        d„ ¦   «         Z e e¦   «         ¦  «        d„ ¦   «         Z e e¦   «         ¦  «        d„ ¦   «         ZdS )ÚTestHypothesisStrategiesz1
        Tests for hyperlink.hypothesis.
        c                 ó†   — 	 t          |¦  «         dS # t          $ r# t          d                     |¦  «        ¦  «        ‚w xY w)zD
            idna_text() generates IDNA-encodable text.
            zInvalid IDNA text: {!r}N)Úidna_encoder   ÚAssertionErrorÚformat)ÚselfÚtexts     úP/var/www/html/env/lib/python3.11/site-packages/hyperlink/test/test_hypothesis.pyÚtest_idna_text_validz-TestHypothesisStrategies.test_idna_text_valid-   sX   € ðMÝ˜DÑ!Ô!Ð!Ð!Ð!øÝð Mð Mð MÝ$Ð%>×%EÒ%EÀdÑ%KÔ%KÑLÔLÐLðMøøøs	   ‚ “-A c                 óÂ   — |                       t          |j        t          d¬¦  «        ¦  «         |                       t          |j        t          d¬¦  «        ¦  «         dS )zO
            idna_text() raises AssertionError if min_size is < 1.
            r   )Úmin_size)Úmax_sizeN)ÚassertRaisesr    Údrawr   )r"   r
   s     r$   Útest_idna_text_min_maxz/TestHypothesisStrategies.test_idna_text_min_max8   sT   € ð ×Òn¨d¬i½ÈAÐ9NÑ9NÔ9NÑOÔOÐOØ×Òn¨d¬i½ÈAÐ9NÑ9NÔ9NÑOÔOÐOÐOÐOó    c                 ó^   — |                       |d¦  «         |                      |d¦  «         dS )z[
            port_numbers() generates integers between 1 and 65535, inclusive.
            r   éÿÿ  N©ÚassertGreaterEqualÚassertLessEqual©r"   Úports     r$   Útest_port_numbers_boundsz1TestHypothesisStrategies.test_port_numbers_boundsA   s6   € ð ×#Ò# D¨!Ñ,Ô,Ð,Ø× Ò   uÑ-Ô-Ð-Ð-Ð-r,   T)Ú
allow_zeroc                 ó^   — |                       |d¦  «         |                      |d¦  «         dS )zv
            port_numbers(allow_zero=True) generates integers between 0 and
            65535, inclusive.
            r   r.   Nr/   r2   s     r$   Ú#test_port_numbers_bounds_allow_zeroz<TestHypothesisStrategies.test_port_numbers_bounds_allow_zeroJ   s6   € ð ×#Ò# D¨!Ñ,Ô,Ð,Ø× Ò   uÑ-Ô-Ð-Ð-Ð-r,   c                 ó¤   — 	 t          |¦  «         t          |¦  «         dS # t          $ r# t          d                     |¦  «        ¦  «        ‚w xY w)zK
            hostname_labels() generates IDN host name labels.
            úInvalid IDN label: {!r}N)r   r   ÚUnicodeErrorr    r!   ©r"   Úlabels     r$   Útest_hostname_labels_valid_idnz7TestHypothesisStrategies.test_hostname_labels_valid_idnT   sf   € ðNÝ˜EÑ"Ô"Ð"Ý˜EÑ"Ô"Ð"Ð"Ð"øÝð Nð Nð NÝ$Ð%>×%EÒ%EÀeÑ%LÔ%LÑMÔMÐMðNøøøs	   ‚" ¢-Aé
   )Úmax_examplesc                 óR  — t           d„ ¦   «         }t          d|¦  «        5   |j        t          ¦   «         ¦  «        }	 t	          |¦  «         t          |¦  «         n0# t          $ r# t          d                     |¦  «        ¦  «        ‚w xY w	 ddd¦  «         dS # 1 swxY w Y   dS )zž
            hostname_labels() handles case where idna_text() generates text
            that encoded to punycode ends up as longer than allowed.
            c                 ó   — d|z  S )Nõ   Ã¡© )r*   r'   r(   s      r$   Úmock_idna_textzWTestHypothesisStrategies.test_hostname_labels_long_idn_punycode.<locals>.mock_idna_texti   s   € ð >ÀÑHÐHr,   zhyperlink.hypothesis.idna_textr9   N)	r   r   r*   r   r   r   r:   r    r!   )r"   r
   rD   r<   s       r$   Ú&test_hostname_labels_long_idn_punycodez?TestHypothesisStrategies.test_hostname_labels_long_idn_punycode`   s  € õ ðIð Iñ ŒYðIõ Ð7¸ÑHÔHð ð Ø!˜œ	¥/Ñ"3Ô"3Ñ4Ô4ðÝ Ñ&Ô&Ð&Ý Ñ&Ô&Ð&Ð&øÝ#ð ð ð Ý(Ø1×8Ò8¸Ñ?Ô?ñô ð ðøøøð 'ð	ð ð ñ ô ð ð ð ð ð ð ð øøøð ð ð ð ð ð s(   ¡B¿AÁBÁ-BÂBÂB Â#B F)Ú	allow_idnc                 ó°   — 	 t          |¦  «         |                     d¦  «         dS # t          $ r# t          d                     |¦  «        ¦  «        ‚w xY w)zO
            hostname_labels() generates a ASCII host name labels.
            ÚasciizInvalid ASCII label: {!r}N)r   r   r:   r    r!   r;   s     r$   Ú test_hostname_labels_valid_asciiz9TestHypothesisStrategies.test_hostname_labels_valid_ascii}   sj   € ðPÝ˜EÑ"Ô"Ð"Ø—’˜WÑ%Ô%Ð%Ð%Ð%øÝð Pð Pð PÝ$Ð%@×%GÒ%GÈÑ%NÔ%NÑOÔOÐOðPøøøs	   ‚$( ¨-Ac                 óÔ   — 	 |                      d¦  «        D ]}t          |¦  «         Œt          |¦  «         dS # t          $ r# t	          d                     |¦  «        ¦  «        ‚w xY w)zA
            hostnames() generates a IDN host names.
            ú.zInvalid IDN host name: {!r}N)Úsplitr   r   r:   r    r!   ©r"   Úhostnamer<   s      r$   Útest_hostnames_idnz+TestHypothesisStrategies.test_hostnames_idn‰   s…   € ðØ%Ÿ^š^¨DÑ1Ô1ð 'ð 'EÝ Ñ&Ô&Ð&Ð&Ý˜HÑ%Ô%Ð%Ð%Ð%øÝð ð ð Ý$Ø1×8Ò8¸ÑBÔBñô ð ðøøøs	   ‚6: º-A')Úallow_leading_digitc                 óh   — |                       ||                     t          ¦  «        k    ¦  «         dS )z}
            hostnames(allow_leading_digit=False) generates a IDN host names
            without leading digits.
            N©Ú
assertTrueÚlstripr   ©r"   rN   s     r$   Útest_hostnames_idn_noleadz2TestHypothesisStrategies.test_hostnames_idn_nolead˜   ó-   € ð OŠO˜H¨¯ª½Ñ(?Ô(?Ò?Ñ@Ô@Ð@Ð@Ð@r,   c                 óà   — 	 |                      d¦  «        D ]}t          |¦  «         Œ|                     d¦  «         dS # t          $ r# t	          d                     |¦  «        ¦  «        ‚w xY w)zC
            hostnames() generates a ASCII host names.
            rK   rH   zInvalid ASCII host name: {!r}N)rL   r   r   r:   r    r!   rM   s      r$   Útest_hostnames_asciiz-TestHypothesisStrategies.test_hostnames_ascii¡   s‰   € ðØ%Ÿ^š^¨DÑ1Ô1ð 'ð 'EÝ Ñ&Ô&Ð&Ð&Ø—’ Ñ(Ô(Ð(Ð(Ð(øÝð ð ð Ý$Ø3×:Ò:¸8ÑDÔDñô ð ðøøøs   ‚<A  Á -A-)rP   rF   c                 óh   — |                       ||                     t          ¦  «        k    ¦  «         dS )zŽ
            hostnames(allow_leading_digit=False, allow_idn=False) generates
            ASCII host names without leading digits.
            NrR   rU   s     r$   Útest_hostnames_ascii_noleadz4TestHypothesisStrategies.test_hostnames_ascii_nolead°   rW   r,   c                 óô   — d                      |¦  «        }	 |                     d¦  «         n0# t          $ r# t          d                     |¦  «        ¦  «        ‚w xY w|D ]}|                      d|¦  «         ŒdS )zM
            paths() generates sequences of URL path components.
            ú/zutf-8zInvalid URL path: {!r}z#/?N)Újoinr   r:   r    r!   ÚassertNotIn)r"   Úpathr#   Úsegments       r$   Ú
test_pathsz#TestHypothesisStrategies.test_paths¹   sž   € ð —9’9˜T‘?”?ˆDðLØ—’˜GÑ$Ô$Ð$Ð$øÝð Lð Lð LÝ$Ð%=×%DÒ%DÀTÑ%JÔ%JÑKÔKÐKðLøøøð  ð 1ð 1Ø× Ò  ¨Ñ0Ô0Ð0Ð0ð1ð 1s	   —- ­-Ac                 ó<   — |                       |t          ¦  «         dS )z?
            encoded_urls() generates EncodedURLs.
            N)ÚassertIsInstancer   ©r"   Úurls     r$   Útest_encoded_urlsz*TestHypothesisStrategies.test_encoded_urlsÈ   ó    € ð ×!Ò! #¥zÑ2Ô2Ð2Ð2Ð2r,   c                 ó<   — |                       |t          ¦  «         dS )z?
            decoded_urls() generates DecodedURLs.
            N)rd   r   re   s     r$   Útest_decoded_urlsz*TestHypothesisStrategies.test_decoded_urlsÐ   rh   r,   N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   r%   r
   r+   r   r4   r7   r   r=   r   rE   rI   r   rO   rV   rY   r[   r   rb   r   rg   r   rj   rC   r,   r$   r   r   (   sÏ  € € € € € ð	ð 	ð 
ˆˆyˆy‰{Œ{Ñ	Ô	ð	Mð 	Mñ 
Ô	ð	Mð 
ˆˆtˆt‰vŒv‰Œð	Pð 	Pñ 
Œð	Pð 
ˆˆ|ˆ|‰~Œ~Ñ	Ô	ð	.ð 	.ñ 
Ô	ð	.ð 
ˆˆ|ˆ| tÐ,Ñ,Ô,Ñ	-Ô	-ð	.ð 	.ñ 
.Ô	-ð	.ð 
ˆˆˆÑ Ô Ñ	!Ô	!ð		Nð 		Nñ 
"Ô	!ð		Nð 
ˆˆtˆt‰vŒv‰ŒØ	ˆ˜rÐ	"Ñ	"Ô	"ð	ð 	ñ 
#Ô	"ñ 
Œð	ð6 
ˆˆˆ¨Ð/Ñ/Ô/Ñ	0Ô	0ð		Pð 		Pñ 
1Ô	0ð		Pð 
ˆˆyˆy‰{Œ{Ñ	Ô	ð	ð 	ñ 
Ô	ð	ð 
ˆˆyˆy¨UÐ3Ñ3Ô3Ñ	4Ô	4ð	Að 	Añ 
5Ô	4ð	Að 
ˆˆyˆy 5Ð)Ñ)Ô)Ñ	*Ô	*ð	ð 	ñ 
+Ô	*ð	ð 
ˆˆyˆy¨U¸eÐDÑDÔDÑ	EÔ	Eð	Að 	Añ 
FÔ	Eð	Að 
ˆˆuˆu‰wŒw‰Œð	1ð 	1ñ 
Œð	1ð 
ˆˆ|ˆ|‰~Œ~Ñ	Ô	ð	3ð 	3ñ 
Ô	ð	3ð 
ˆˆ|ˆ|‰~Œ~Ñ	Ô	ð	3ð 	3ñ 
Ô	ð	3ð 	3ð 	3r,   r   )$rn   Ú
hypothesisÚstringr   Útypingr   r   Úunittest.mockr   ÚImportErrorÚmockr   r   Úhypothesis.strategiesr	   r
   Úidnar   r   r   r   Úcommonr   Ú r   r   r   r   r   r   r   r   r   r   r   r   rC   r,   r$   ú<module>ry      sè  ððð ðP3ØÐÐÐàð ÐÐÐÐÐØ%Ð%Ð%Ð%Ð%Ð%Ð%Ð%ðØ'Ð'Ð'Ð'Ð'Ð'Ð'øØð ð ð ØÐÐÐÐÐÐÐðøøøð +Ð*Ð*Ð*Ð*Ð*Ð*Ð*Ø:Ð:Ð:Ð:Ð:Ð:Ð:Ð:àBÐBÐBÐBÐBÐBÐBÐBÐBÐBà)Ð)Ð)Ð)Ð)Ð)Ø)Ð)Ð)Ð)Ð)Ð)Ð)Ð)ð
ð 
ð 
ð 
ð 
ð 
ð 
ð 
ð 
ð 
ð 
ð 
ð 
ð 
ð 
ð 
ð 
ð 
ð 
ð 
ð 
ð 
ðn3ð n3ð n3ð n3ð n3Ð#4ñ n3ô n3ð n3ð n3ð n3øð= ð 	ð 	ð 	Ø€D€Dð	øøøs   „A> ˜ Ÿ-¬-Á>BÂB