+
    üÐj)  ã                   ó¬   € R t ^ RIHt ^ RIHtHtHtHt  ! R R]P                  4      t	 ! R R]P                  4      t
 ! R R]P                  4      tR	# )
z!
Tests for L{twisted.web._abnf}.
)Úunittest)Ú_decintÚ_hexintÚ_ishexdigitsÚ_istokenc                   óH   a € ] tR t^t o RtV 3R lR ltV 3R lR ltRtV tR# )ÚIsTokenTestsz2
Test the L{twisted.web._abnf._istoken} function.
c                ó   <€ V ^8„  d   QhRR/# ©é   ÚreturnN© )ÚformatÚ__classdict__s   "€Ú</usr/lib/python3/dist-packages/twisted/web/test/test_abnf.pyÚ__annotate__ÚIsTokenTests.__annotate__   s   ø€ ÷ )ñ )˜ñ )ó    c                óL   € R F  pV P                  \        V4      4       K  	  R# )ó   GETN)r   s   Cache-Controló   &)Ú
assertTruer   ©ÚselfÚbs   & r   Útest_okÚIsTokenTests.test_ok   s    € ó
ˆAð
 �O‰OœH Q›KÖ(ó
r   c                ó   <€ V ^8„  d   QhRR/# r
   r   )r   r   s   "€r   r   r      s   ø€ ÷ *ñ *˜$ñ *r   c                óL   € R F  pV P                  \        V4      4       K  	  R# )r   N)r   ó    s   a b)ÚassertFalser   r   s   & r   Útest_badÚIsTokenTests.test_bad   s"   € ó
ˆAð
 ×ÑœX a›[Ö)ó
r   r   N)	Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r   r!   Ú__static_attributes__Ú__classdictcell__©r   s   @r   r   r      s   ø‡ € ñ÷)ð )÷*ö *r   r   c                   ó~   a € ] tR t^"t o RtV 3R lR ltV 3R lR ltV 3R lR ltV 3R lR	 ltV 3R
 lR lt	Rt
V tR# )ÚDecintTestsz1
Test the L{twisted.web._abnf._decint} function.
c                ó   <€ V ^8„  d   QhRR/# r
   r   )r   r   s   "€r   r   ÚDecintTests.__annotate__'   s   ø€ ÷ 4ñ 4˜Dñ 4r   c                óÞ   € V P                  ^\        R4      4       V P                  ^
\        R4      4       V P                  R\        R4      4       V P                  R\        R4      4       R# )z6
Given a decimal digits, L{_decint} return an L{int}.
ó   1ó   10i(#  s   9000s   0009000N©ÚassertEqualr   ©r   s   &r   Ú
test_validÚDecintTests.test_valid'   sV   € ð 	×Ñ˜œG D›MÔ*Ø×Ñ˜œW U›^Ô,Ø×Ñ˜œw wÓ/Ô0Ø×Ñ˜œw zÓ2Ö3r   c                ó   <€ V ^8„  d   QhRR/# r
   r   )r   r   s   "€r   r   r.   0   s   ø€ ÷ :ñ : dñ :r   c                ó¨   € V P                  ^{\        R4      4       V P                  ^{\        R4      4       V P                  ^{\        R4      4       R# )z<
L{_decint} decodes integers embedded in linear whitespace.
s    123s   123		s    	 123   	  Nr2   r4   s   &r   Útest_validWhitespaceÚ DecintTests.test_validWhitespace0   sD   € ð 	×Ñ˜œg gÓ.Ô/Ø×Ñ˜œg jÓ1Ô2Ø×Ñ˜œgÐ&7Ó8Ö9r   c                ó   <€ V ^8„  d   QhRR/# r
   r   )r   r   s   "€r   r   r.   8   s   ø€ ÷ 6ñ 6 $ñ 6r   c                ó<   € V P                  \        \        R4       R# )z<
L{_decint} rejects a number with a leading C{+} character.
s   +1N©ÚassertRaisesÚ
ValueErrorr   r4   s   &r   Útest_invalidPlusÚDecintTests.test_invalidPlus8   ó   € ð 	×Ñœ*¤g¨uÖ5r   c                ó   <€ V ^8„  d   QhRR/# r
   r   )r   r   s   "€r   r   r.   >   s   ø€ ÷ 6ñ 6 4ñ 6r   c                ó<   € V P                  \        \        R4       R# )z<
L{_decint} rejects a number with a leading C{-} character.
s   -1Nr=   r4   s   &r   Útest_invalidMinusÚDecintTests.test_invalidMinus>   rB   r   c                ó   <€ V ^8„  d   QhRR/# r
   r   )r   r   s   "€r   r   r.   D   s   ø€ ÷ 9ñ 9¨ñ 9r   c                ó¨   € V P                  \        \        R4       V P                  \        \        R4       V P                  \        \        R4       R# )z@
L{_decint} rejects a number embedded in non-linear whitespace.
s   1s   1s   1Nr=   r4   s   &r   Útest_invalidWhitespaceÚ"DecintTests.test_invalidWhitespaceD   s:   € ð 	×Ñœ*¤g¨vÔ6Ø×Ñœ*¤g¨xÔ8Ø×Ñœ*¤g¨xÖ8r   r   N)r#   r$   r%   r&   r'   r5   r9   r@   rE   rI   r(   r)   r*   s   @r   r,   r,   "   s<   ø‡ € ñ÷4ð 4÷:ð :÷6ð 6÷6ð 6÷9ö 9r   r,   c                   óp   a € ] tR t^Mt o RtRtV 3R lR ltV 3R lR ltV 3R lR ltV 3R lR	 lt	R
t
V tR# )ÚHexHelperTestszM
Test the L{twisted.web._abnf._hexint} and L{_ishexdigits} helper functions.
c                ó   <€ V ^8„  d   QhRR/# r
   r   )r   r   s   "€r   r   ÚHexHelperTests.__annotate__T   s   ø€ ÷ 1ñ 1˜Dñ 1r   c                óN   € R F  pV P                  R\        V4      4       K   	  R# )zZ
L{_ishexdigits()} returns L{True} for nonempy bytestrings containing
hexadecimal digits.
TN)r1   s   abcdefs   AB1234s   feds	   123467890)ÚassertIsr   ©r   Úss   & r   Ú
test_isHexÚHexHelperTests.test_isHexT   s"   € ó
 EˆAØ�M‰M˜$¤¨Q£Ö0ó Er   c                ó   <€ V ^8„  d   QhRR/# r
   r   )r   r   s   "€r   r   rN   \   s   ø€ ÷ 9ñ 9˜dñ 9r   c                ó¨   € V P                  ^
\        R4      4       V P                  ^\        R4      4       V P                  R\        R4      4       R# )z;
L{_hexint()} returns the integer equivalent of the input.
ó   ar1   i#Ñ¼
s   abCD123N)r3   r   r4   s   &r   Útest_decodesÚHexHelperTests.test_decodes\   sA   € ð 	×Ñ˜œW T›]Ô+Ø×Ñ˜œw u›~Ô.Ø×Ñ˜¤G¨JÓ$7Ö8r   c                ó   <€ V ^8„  d   QhRR/# r
   r   )r   r   s   "€r   r   rN   d   s   ø€ ÷ 2ñ 2˜tñ 2r   c                ób   € V P                    F  pV P                  R\        V4      4       K   	  R# )zw
L{_ishexdigits()} returns L{False} for bytestrings that don't contain
hexadecimal digits, including the empty string.
FN)Ú
badStringsrP   r   rQ   s   & r   Útest_isNotHexÚHexHelperTests.test_isNotHexd   s$   € ð
 —”ˆAØ�M‰M˜%¤¨a£Ö1ó !r   c                ó   <€ V ^8„  d   QhRR/# r
   r   )r   r   s   "€r   r   rN   l   s   ø€ ÷ 6ñ 6 4ñ 6r   c                ób   € V P                    F  pV P                  \        \        V4       K   	  R# )zJ
L{_hexint()} raises L{ValueError} for bytestrings that can't
be decoded.
N)r\   r>   r?   r   rQ   s   & r   Útest_decodeNotHexÚ HexHelperTests.test_decodeNotHexl   s$   € ð
 —”ˆAØ×Ñœj¬'°1Ö5ó !r   r   N)r   s   0x1234s   fedss   -123+123)r#   r$   r%   r&   r'   r\   rS   rX   r]   ra   r(   r)   r*   s   @r   rL   rL   M   s9   ø‡ € ñð <€J÷1ð 1÷9ð 9÷2ð 2÷6ö 6r   rL   N)r'   Útwisted.trialr   Útwisted.web._abnfr   r   r   r   ÚSynchronousTestCaser   r,   rL   r   r   r   Ú<module>rf      sL   ðñõ #ß FÓ Fô*�8×/Ñ/ô *ô,(9�(×.Ñ.ô (9ôV%6�X×1Ñ1ö %6r   