+
    m4i                        R t  ^ RItA^ RIHt ^ RIHtHt  ^ RIHt ^ RIHtHt ^ RIHtHt ^ RIHtHtHt ^RIHt ^R	IHtHt ^R
IHtHtHtHtHtHtH t H!t!H"t"  ! R R]4      t#R#   ]	 d
    ^ RI
Ht  LZi ; i  ]	 d     R# i ; i)!
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                   f  a  ] tR t^(t o Rt]! ]! 4       4      R 4       t]! ]! 4       4      R 4       t	]! ]
! 4       4      R 4       t]! ]
! RR7      4      R 4       t]! ]! 4       4      R 4       t]! ]! 4       4      ]! ^
R	7      R
 4       4       t]! ]! RR7      4      R 4       t]! ]! 4       4      R 4       t]! ]! RR7      4      R 4       t]! ]! RR7      4      R 4       t]! ]! RRR7      4      R 4       t]! ]! 4       4      R 4       t]! ]! 4       4      R 4       t]! ]! 4       4      R 4       tRtV tR# )TestHypothesisStrategiesr   c                p     \        V4       R#   \         d    \        RP                  T4      4      hi ; i)z,
idna_text() generates IDNA-encodable text.
zInvalid IDNA text: {!r}N)idna_encoder   AssertionErrorformat)selftexts   &&@/usr/lib/python3/dist-packages/hyperlink/test/test_hypothesis.pytest_idna_text_valid-TestHypothesisStrategies.test_idna_text_valid-   s8    MD! M$%>%E%Ed%KLLMs    &5c                    V P                  \        VP                  \        ^ R7      4       V P                  \        VP                  \        ^ R7      4       R# )z7
idna_text() raises AssertionError if min_size is < 1.
)min_size)max_sizeN)assertRaisesr   drawr   )r    r
   s   &&r"   test_idna_text_min_max/TestHypothesisStrategies.test_idna_text_min_max8   s:     ndiiA9NOndiiA9NO    c                N    V P                  V^4       V P                  VR4       R# )zC
port_numbers() generates integers between 1 and 65535, inclusive.
  NassertGreaterEqualassertLessEqualr    ports   &&r"   test_port_numbers_bounds1TestHypothesisStrategies.test_port_numbers_boundsA   s$     ##D!,  u-r,   T)
allow_zeroc                N    V P                  V^ 4       V P                  VR4       R# )zR
port_numbers(allow_zero=True) generates integers between 0 and
65535, inclusive.
r.   Nr/   r2   s   &&r"   #test_port_numbers_bounds_allow_zero<TestHypothesisStrategies.test_port_numbers_bounds_allow_zeroJ   s$     ##D!,  u-r,   c                     \        V4       \        V4       R#   \         d    \        RP	                  T4      4      hi ; i)z3
hostname_labels() generates IDN host name labels.
Invalid IDN label: {!r}N)r   r   UnicodeErrorr   r   r    labels   &&r"   test_hostname_labels_valid_idn7TestHypothesisStrategies.test_hostname_labels_valid_idnT   s@    NE"E" N$%>%E%Ee%LMMNs	    &A )max_examplesc                6   \         R 4       p\        RV4      ;_uu_ 4        VP                  ! \        4       4      p \	        V4       \        V4        RRR4       R#   \         d    \        RP                  T4      4      hi ; i  + '       g   i     R# ; i)zz
hostname_labels() handles case where idna_text() generates text
that encoded to punycode ends up as longer than allowed.
c                     R V,          # )   á )r)   r&   r'   s   &&&r"   mock_idna_textWTestHypothesisStrategies.test_hostname_labels_long_idn_punycode.<locals>.mock_idna_texti   s     >HHr,   zhyperlink.hypothesis.idna_textr;   N)	r   r   r)   r   r   r   r<   r   r   )r    r
   rF   r>   s   &&  r"   &test_hostname_labels_long_idn_punycode?TestHypothesisStrategies.test_hostname_labels_long_idn_punycode`   s     I I 7HH		/"34&&	 IH
 $ (188?  IHHs   BA&BBB	F)	allow_idnc                     \        V4       VP                  R4       R#   \         d    \        RP	                  T4      4      hi ; i)z7
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_ascii9TestHypothesisStrategies.test_hostname_labels_valid_ascii}   sD    PE"W% P$%@%G%G%NOOPs	     &Ac                     VP                  R4       F  p\        V4       K  	  \        V4       R#   \         d    \	        RP                  T4      4      hi ; i)z)
hostnames() generates a IDN host names.
.zInvalid IDN host name: {!r}N)splitr   r   r<   r   r   r    hostnamer>   s   && r"   test_hostnames_idn+TestHypothesisStrategies.test_hostnames_idn   sT    %^^D1E& 2H% $188B s	   .2 &A)allow_leading_digitc                R    V P                  WP                  \        4      8H  4       R# )zY
hostnames(allow_leading_digit=False) generates a IDN host names
without leading digits.
N
assertTruelstripr   r    rS   s   &&r"   test_hostnames_idn_nolead2TestHypothesisStrategies.test_hostnames_idn_nolead        OOH(??@r,   c                     VP                  R4       F  p\        V4       K  	  VP                  R4       R#   \         d    \	        RP                  T4      4      hi ; i)z+
hostnames() generates a ASCII host names.
rP   rL   zInvalid ASCII host name: {!r}N)rQ   r   r   r<   r   r   rR   s   && r"   test_hostnames_ascii-TestHypothesisStrategies.test_hostnames_ascii   sX    %^^D1E& 2( $3::8D s	   48 &A)rV   rJ   c                R    V P                  WP                  \        4      8H  4       R# )zj
hostnames(allow_leading_digit=False, allow_idn=False) generates
ASCII host names without leading digits.
NrX   r[   s   &&r"   test_hostnames_ascii_nolead4TestHypothesisStrategies.test_hostnames_ascii_nolead   r^   r,   c                    RP                  V4      p VP                  R4       T F  pT P                  RT4       K  	  R#   \         d    \        RP	                  T4      4      hi ; i)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     99T?DLG$    0     L$%=%D%DT%JKKLs   A &A'c                2    V P                  V\        4       R# )z'
encoded_urls() generates EncodedURLs.
N)assertIsInstancer   r    urls   &&r"   test_encoded_urls*TestHypothesisStrategies.test_encoded_urls        !!#z2r,   c                2    V P                  V\        4       R# )z'
decoded_urls() generates DecodedURLs.
N)rn   r   ro   s   &&r"   test_decoded_urls*TestHypothesisStrategies.test_decoded_urls   rs   r,   rE   N)__name__
__module____qualname____firstlineno____doc__r   r   r#   r
   r*   r   r4   r8   r   r?   r   rH   rM   r   rT   r\   r`   rc   r   rk   r   rq   r   ru   __static_attributes____classdictcell__)__classdict__s   @r"   r   r   (   s    	 
y{		M 
	M 
tv	P 
	P 
|~		. 
	. 
|t,	-	. 
.	. 
 	!		N 
"		N 
tv	r	"	 
# 
	6 
/	0		P 
1		P 
y{		 
	 
yU3	4	A 
5	A 
y5)	*	 
+	 
yUeD	E	A 
F	A 
uw	1 
	1 
|~		3 
	3 
|~		3 
	3r,   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   rE   r,   r"   <module>r      s   P3 %' +:BB))
 
 
n3#4 n3-    		s"   A< A) )A98A9<BB