ó
    Ô›‘hç  ã                   ó  • S r  SSKrCSSKJr  SSKJrJr   SSKJr  SSKJrJr  SSKJrJr  SSKJrJrJr  S	S
KJr  SSKJrJr  SSKJrJrJrJrJrJrJ r J!r!J"r"   " S S\5      r#g! \	 a	    SSK
Jr   NXf = f! \	 a     gf = f)ú!
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                   ó6  • \ rS rSrSr\" \" 5       5      S 5       r\" \" 5       5      S 5       r	\" \
" 5       5      S 5       r\" \
" SS95      S 5       r\" \" 5       5      S	 5       r\" \" 5       5      \" S
S9S 5       5       r\" \" SS95      S 5       r\" \" 5       5      S 5       r\" \" SS95      S 5       r\" \" SS95      S 5       r\" \" SSS95      S 5       r\" \" 5       5      S 5       r\" \" 5       5      S 5       r\" \" 5       5      S 5       rSrg)ÚTestHypothesisStrategiesé(   r   c                 ól   •  [        U5        g! [         a    [        SR                  U5      5      ef = f)z,
idna_text() generates IDNA-encodable text.
zInvalid IDNA text: {!r}N)Úidna_encoder   ÚAssertionErrorÚformat)ÚselfÚtexts     ÚbC:\Users\psant\Downloads\Noiseback\school\venv\Lib\site-packages\hyperlink/test/test_hypothesis.pyÚtest_idna_text_validÚ-TestHypothesisStrategies.test_idna_text_valid-   s8   € ðMÜ˜DÕ!øÜó MÜ$Ð%>×%EÑ%EÀdÓ%KÓLÐLðMús   ‚ Ž%3c                 ó¤   • U R                  [        UR                  [        SS95        U R                  [        UR                  [        SS95        g)z7
idna_text() raises AssertionError if min_size is < 1.
r   )Úmin_size)Úmax_sizeN)ÚassertRaisesr"   Údrawr   )r$   r   s     r&   Útest_idna_text_min_maxÚ/TestHypothesisStrategies.test_idna_text_min_max8   s:   € ð ×Ñœn¨d¯i©i¼ÈAÑ9NÔOØ×Ñœn¨d¯i©i¼ÈAÑ9NÕOó    c                 óL   • U R                  US5        U R                  US5        g)zC
port_numbers() generates integers between 1 and 65535, inclusive.
r   éÿÿ  N©ÚassertGreaterEqualÚassertLessEqual©r$   Úports     r&   Útest_port_numbers_boundsÚ1TestHypothesisStrategies.test_port_numbers_boundsA   s$   € ð ×#Ñ# D¨!Ô,Ø× Ñ   uÕ-r0   T)Ú
allow_zeroc                 óL   • U R                  US5        U R                  US5        g)zR
port_numbers(allow_zero=True) generates integers between 0 and
65535, inclusive.
r   r2   Nr3   r6   s     r&   Ú#test_port_numbers_bounds_allow_zeroÚ<TestHypothesisStrategies.test_port_numbers_bounds_allow_zeroJ   s$   € ð ×#Ñ# D¨!Ô,Ø× Ñ   uÕ-r0   c                 ó‚   •  [        U5        [        U5        g! [         a    [        SR	                  U5      5      ef = f)z3
hostname_labels() generates IDN host name labels.
úInvalid IDN label: {!r}N)r   r!   ÚUnicodeErrorr"   r#   ©r$   Úlabels     r&   Útest_hostname_labels_valid_idnÚ7TestHypothesisStrategies.test_hostname_labels_valid_idnT   s@   € ðNÜ˜EÔ"Ü˜EÕ"øÜó NÜ$Ð%>×%EÑ%EÀeÓ%LÓMÐMðNús   ‚ ™%>é
   )Úmax_examplesc                 ó  • [         S 5       n[        SU5         UR                  " [        5       5      n [	        U5        [        U5         SSS5        g! [         a    [        SR                  U5      5      ef = f! , (       d  f       g= f)zz
hostname_labels() handles case where idna_text() generates text
that encoded to punycode ends up as longer than allowed.
c                 ó   • SU-  $ )Nô   Ã¡© )r-   r*   r+   s      r&   Úmock_idna_textÚWTestHypothesisStrategies.test_hostname_labels_long_idn_punycode.<locals>.mock_idna_texti   s   € ð >ÀÑHÐHr0   zhyperlink.hypothesis.idna_textr?   N)	r   r   r-   r   r   r!   r@   r"   r#   )r$   r   rK   rB   s       r&   Ú&test_hostname_labels_long_idn_punycodeÚ?TestHypothesisStrategies.test_hostname_labels_long_idn_punycode`   sŠ   € ô ñIó ðIô Ð7¸ÕHØŸ	š	¤/Ó"3Ó4�ðÜ Ô&Ü Õ&÷	 IÐHøô
 $ó Ü(Ø1×8Ñ8¸Ó?óð ðú÷ IÕHús   ™A=µAÁ%A:Á:A=Á=
BF)Ú	allow_idnc                 óŽ   •  [        U5        UR                  S5        g! [         a    [        SR	                  U5      5      ef = f)z7
hostname_labels() generates a ASCII host name labels.
ÚasciizInvalid ASCII label: {!r}N)r   r   r@   r"   r#   rA   s     r&   Ú test_hostname_labels_valid_asciiÚ9TestHypothesisStrategies.test_hostname_labels_valid_ascii}   sD   € ðPÜ˜EÔ"Ø—‘˜WÕ%øÜó PÜ$Ð%@×%GÑ%GÈÓ%NÓOÐOðPús	   ‚ Ÿ%Ac                 ó²   •  UR                  S5       H  n[        U5        M     [        U5        g! [         a    [	        SR                  U5      5      ef = f)z)
hostnames() generates a IDN host names.
Ú.zInvalid IDN host name: {!r}N)Úsplitr   r!   r@   r"   r#   ©r$   ÚhostnamerB   s      r&   Útest_hostnames_idnÚ+TestHypothesisStrategies.test_hostnames_idn‰   sT   € ðØ%Ÿ^™^¨DÖ1�EÜ Ö&ñ 2ä˜HÕ%øÜó Ü$Ø1×8Ñ8¸ÓBóð ðús	   ‚.1 ±%A)Úallow_leading_digitc                 óP   • U R                  XR                  [        5      :H  5        g)zY
hostnames(allow_leading_digit=False) generates a IDN host names
without leading digits.
N©Ú
assertTrueÚlstripr   ©r$   rX   s     r&   Útest_hostnames_idn_noleadÚ2TestHypothesisStrategies.test_hostnames_idn_nolead˜   ó   € ð �O‰O˜H¯©¼Ó(?Ñ?Õ@r0   c                 ó¾   •  UR                  S5       H  n[        U5        M     UR                  S5        g! [         a    [	        SR                  U5      5      ef = f)z+
hostnames() generates a ASCII host names.
rU   rQ   zInvalid ASCII host name: {!r}N)rV   r   r   r@   r"   r#   rW   s      r&   Útest_hostnames_asciiÚ-TestHypothesisStrategies.test_hostnames_ascii¡   sX   € ðØ%Ÿ^™^¨DÖ1�EÜ Ö&ñ 2à—‘ Õ(øÜó Ü$Ø3×:Ñ:¸8ÓDóð ðús	   ‚47 ·%A)r[   rO   c                 óP   • U R                  XR                  [        5      :H  5        g)zj
hostnames(allow_leading_digit=False, allow_idn=False) generates
ASCII host names without leading digits.
Nr]   r`   s     r&   Útest_hostnames_ascii_noleadÚ4TestHypothesisStrategies.test_hostnames_ascii_nolead°   rc   r0   c                 óÐ   • SR                  U5      n UR                  S5        U H  nU R                  SU5        M     g! [         a    [        SR	                  U5      5      ef = f)z5
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_pathsÚ#TestHypothesisStrategies.test_paths¹   si   € ð —9‘9˜T“?ˆDðLØ—‘˜GÔ$ó  �Ø× Ñ  ¨Ö0ò  øô  ó LÜ$Ð%=×%DÑ%DÀTÓ%JÓKÐKðLús   “A  Á %A%c                 ó0   • U R                  U[        5        g)z'
encoded_urls() generates EncodedURLs.
N)ÚassertIsInstancer   ©r$   Úurls     r&   Útest_encoded_urlsÚ*TestHypothesisStrategies.test_encoded_urlsÈ   ó   € ð ×!Ñ! #¤zÕ2r0   c                 ó0   • U R                  U[        5        g)z'
decoded_urls() generates DecodedURLs.
N)rs   r   rt   s     r&   Útest_decoded_urlsÚ*TestHypothesisStrategies.test_decoded_urlsÐ   rx   r0   rJ   N)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r   r   r'   r   r.   r   r8   r<   r   rC   r	   rM   rR   r   rY   ra   re   rh   r   rp   r   rv   r   rz   Ú__static_attributes__rJ   r0   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ó 
ó	3r0   r   )$r€   Ú
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   rJ   r0   r&   Ú<module>rŒ      s   ðñðP3Ûàõ ß%ðÝ'÷ +ß:çBÑBå)ß)÷
÷ 
õ 
ôn3Ð#4õ n3øð- ó ßðûð ó 	Ùð	ús"   „A: ˜A( Á(A7Á6A7Á:BÂB