Ë
    „ÇVhç  ã                   ó  — d Z 	 ddlZ[ddlmZ ddlmZmZ 	 ddlmZ 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#y# e	$ r	 ddl
mZ Y ŒWw xY w# e	$ r Y y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                   óR  — 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y)ÚTestHypothesisStrategiesz1
        Tests for hyperlink.hypothesis.
        c                 ój   — 	 t        |«       y# t        $ r t        dj                  |«      «      ‚w xY w)zD
            idna_text() generates IDNA-encodable text.
            zInvalid IDNA text: {!r}N)Úidna_encoder   ÚAssertionErrorÚformat)ÚselfÚtexts     úN/home/dcms/DCMS/lib/python3.12/site-packages/hyperlink/test/test_hypothesis.pyÚtest_idna_text_validz-TestHypothesisStrategies.test_idna_text_valid-   s8   € ðMÜ˜DÕ!øÜò MÜ$Ð%>×%EÑ%EÀdÓ%KÓLÐLðMús   ‚ Ž$2c                 ó°   — | j                  t        |j                  t        d¬«      «       | j                  t        |j                  t        d¬«      «       y)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   s:   € ð ×Ñœn¨d¯i©i¼ÈAÔ9NÔOØ×Ñœn¨d¯i©i¼ÈAÔ9NÕOó    c                 óL   — | j                  |d«       | j                  |d«       y)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   s$   € ð ×#Ñ# D¨!Ô,Ø× Ñ   uÕ-r,   T)Ú
allow_zeroc                 óL   — | j                  |d«       | j                  |d«       y)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   s$   € ð ×#Ñ# D¨!Ô,Ø× Ñ   uÕ-r,   c                 ó€   — 	 t        |«       t        |«       y# t        $ r t        dj	                  |«      «      ‚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   s@   € ðNÜ˜EÔ"Ü˜EÕ"øÜò NÜ$Ð%>×%EÑ%EÀeÓ%LÓMÐMðNús   ‚ ™$=é
   )Úmax_examplesc                 ó  — t         d„ «       }t        d|«      5   |j                  t        «       «      }	 t	        |«       t        |«       	 ddd«       y# t        $ r t        dj                  |«      «      ‚w xY w# 1 sw Y   yxY w)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ô Ð7¸ÓHñ Ø!˜Ÿ	™	¤/Ó"3Ó4ðÜ Ô&Ü Õ&÷	ð øô
 $ò Ü(Ø1×8Ñ8¸Ó?óð ðú÷ð ús   ™A<µAÁ$A9Á9A<Á<BF)Ú	allow_idnc                 óŒ   — 	 t        |«       |j                  d«       y# t        $ r t        dj	                  |«      «      ‚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}   sD   € ðPÜ˜EÔ"Ø—‘˜WÕ%øÜò PÜ$Ð%@×%GÑ%GÈÓ%NÓOÐOðPús	   ‚ Ÿ$Ac                 ó¬   — 	 |j                  d«      D ]  }t        |«       Œ t        |«       y# t        $ r t	        dj                  |«      «      ‚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‰   sY   € ðØ%Ÿ^™^¨DÓ1ò 'EÜ Õ&ð'ä˜HÕ%øÜò Ü$Ø1×8Ñ8¸ÓBóð ðús	   ‚,/ ¯$A)Úallow_leading_digitc                 óR   — | j                  ||j                  t        «      k(  «       y)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                 ó¸   — 	 |j                  d«      D ]  }t        |«       Œ |j                  d«       y# t        $ r t	        dj                  |«      «      ‚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ò 'EÜ Õ&ð'à—‘ Õ(øÜò Ü$Ø3×:Ñ:¸8ÓDóð ðús	   ‚25 µ$A)rP   rF   c                 óR   — | j                  ||j                  t        «      k(  «       y)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j                  |«      }	 |j                  d«       |D ]  }| j                  d|«       Œ y# t        $ r t        dj	                  |«      «      ‚w xY w)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¹   sn   € ð —9‘9˜T“?ˆDðLØ—‘˜GÔ$ð  ò 1Ø× Ñ  ¨Õ0ñ1øô  ò LÜ$Ð%=×%DÑ%DÀTÓ%JÓKÐKðLús	   “> ¾$A"c                 ó0   — | j                  |t        «       y)z?
            encoded_urls() generates EncodedURLs.
            N)ÚassertIsInstancer   ©r"   Úurls     r$   Útest_encoded_urlsz*TestHypothesisStrategies.test_encoded_urlsÈ   ó   € ð ×!Ñ! #¤zÕ2r,   c                 ó0   — | j                  |t        «       y)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‹{Ó	ñ	Mó 
ð	Mñ 
‰t‹v‹ñ	Pó 
ð	Pñ 
‰|‹~Ó	ñ	.ó 
ð	.ñ 
‰| tÔ,Ó	-ñ	.ó 
.ð	.ñ 
‰Ó Ó	!ñ		Nó 
"ð		Nñ 
‰t‹v‹Ù	˜rÔ	"ñ	ó 
#ó 
ð	ñ6 
‰¨Ô/Ó	0ñ		Pó 
1ð		Pñ 
‰y‹{Ó	ñ	ó 
ð	ñ 
‰y¨UÔ3Ó	4ñ	Aó 
5ð	Añ 
‰y 5Ô)Ó	*ñ	ó 
+ð	ñ 
‰y¨U¸eÔDÓ	Eñ	Aó 
Fð	Añ 
‰u‹w‹ñ	1ó 
ð	1ñ 
‰|‹~Ó	ñ	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å)ß)÷
÷ 
õ 
ôn3Ð#4õ n3øð- ò ßðûð ò 	Ùð	ús"   „A9 ˜A( Á(A6Á5A6Á9BÂ B