+
    i2#                    @   R t ^ RIHt ^ RIHt ]'       d   ^ RIHt M^ RIHt ^ RIt^ RI	H
t
 ^ RIt]P                  ! ]4      t^ RIt^ RIt^ RIHt ^ RIHtHt ^ RIHtHt ^ R	IHtHt ^ R
IHtHtHtHtH t H!t! ^ RI"H#u H$t% ^ RI&H't'H(t(H)t)H*t*H+t+H,t, ^ RI-H.t.H/t0H1t2H3t3 ]Ph                  Pk                  ]Ph                  Pm                  ]74      4      t8R t9 ! R R]'4      t:^ RI;t;^ RI<t< ! R R]%Pz                  4      t> ! R R]%Pz                  4      t? ! R R]'4      t@R# )ztests for passlib.context)with_statement)PY3)NoSectionErrorN)partial)hash)CryptContextLazyCryptContext)PasslibConfigWarningPasslibHashWarning)tick
to_unicode)irangeuunicodestr_to_uasciiPY2PY26)TestCaseset_fileTICK_RESOLUTION
quicksleep	time_callhandler_derived_from)register_crypt_handler_path_has_crypt_handler_unload_handler_nameget_crypt_handlerc                     V P                  4       pV F  pVP                  V4       K  	  V'       d   VP                  V4       V# N)copyupdate)firstargskwdstargetargs   &*,  X/var/www/html/photoedit/myenv/lib/python3.14/site-packages/passlib/tests/test_context.pymerge_dictsr'   &   s7    ZZ\Fc dM    c                     aa ] tR t^1t oRt. RLOt] U u. uF  p \        V 4      NK  	  up t]! ]RRRRRR	R
7      t	]
! ]	]R7      t]! R4      t]! R4      t]P                   P#                  ]R4      t]P)                  ]! R4      ]! R4      4      t]P                   P#                  ]R4      t]P)                  ]! R4      ]! R4      4      P/                  R4      t]P                   P#                  ]R4      t ]! RRRRR7      tRt]
! ]	]4      t]! RR7      t]
! ]]4      t]! . RMOR.R^^^ RRRR ^R!7      t T3R" lt!R# t"R$ t#R% t$R& t%R' t&R( t'R) t(R* t)R+ t*R, t+R- t,R. t-R/ t.RNR1 lt/R2 t0R3 t1R4 t2R5 t3R6 t4R7 t5R0/ 3R0R8R/3^/ 3RK/ 3.t6R9 t7R: t8R; t9R< t:ROR= lt;R> t<R? t=R@ t>RA t?RB t@RC tARD tBRE tCRF tDRG tERH tFRI tGRJ tHRKtITtJT;tK# u up i )PCryptContextTestr   	des_crypt	md5_cryptsha512_crypt皙?i1u  ia  iP  @  )schemesdefaultall__vary_roundsbsdi_crypt__max_roundsbsdi_crypt__default_roundssha512_crypt__max_roundssha512_crypt__min_roundsr0   a  [passlib]
schemes = des_crypt, md5_crypt, bsdi_crypt, sha512_crypt
default = md5_crypt
; this is using %...
all__vary_rounds = 10%%
bsdi_crypt__default_rounds = 25001
bsdi_crypt__max_rounds = 30001
sha512_crypt__max_rounds = 50000
sha512_crypt__min_rounds = 40000
z[passlib]
schemes = des_crypt, md5_crypt, bsdi_crypt, sha512_crypt
default = md5_crypt
all__vary_rounds = 0.1
bsdi_crypt__default_rounds = 25001
bsdi_crypt__max_rounds = 30001
sha512_crypt__max_rounds = 50000
sha512_crypt__min_rounds = 40000

zsample1.cfg
z
zsample1b.cfg	[passlib]z
[mypolicy]utf-16zsample1c.cfgiIq  i  iy  iȯ  )bsdi_crypt__min_roundsr3   r4   r6   z[passlib]
bsdi_crypt__min_rounds = 29001
bsdi_crypt__max_rounds = 35001
bsdi_crypt__default_rounds = 31001
sha512_crypt__min_rounds = 45000
r1   sha256_crypt    H)r0   
deprecatedr1   r3   r4   bsdi_crypt__vary_roundssha256_crypt__max_roundssha256_crypt__min_roundssha256_crypt__default_roundsphpass__identphpass__default_roundsc                   < \         \        V `  4        \        P                  ! R R4       \        P                  ! R R4       R# )ignorez The 'all' scheme is deprecated.*z4.*'scheme' keyword is deprecated as of Passlib 1.7.*N)superr*   setUpwarningsfilterwarnings)self	__class__s   &r&   rK   CryptContextTest.setUp   s3    +-*LM*`ar(   c                   \        4       pV P                  VP                  4       / 4       \        R/ V P                  B pV P                  VP                  4       V P                  4       \        R/ V P                  B pV P                  VP                  4       V P                  4       \        R/ V P
                  B pV P                  VP                  4       V P
                  4       \        R/ V P                  B pV P                  VP                  4       V P                  4       \        \        R4      .R7      pV P                  VP                  4       R4       R# )ztest class constructorr=   r7   N )r=   )	r   assertEqualto_dictsample_1_dictsample_1_resolved_dictsample_2_dictsample_3_dictr   r0   rN   ctxs   & r&   test_01_constructor$CryptContextTest.test_01_constructor   s    n+ 0T//0(:(:; 9T889(:(:; 0T//0(:(:; 0T//0(:(:; An$5#67(9:r(   c                   \         P                  ! V P                  4      pV P                  VP	                  4       V P
                  4       \         P                  ! V P                  4      pV P                  VP	                  4       V P
                  4       \         P                  ! V P                  P                  R4      4      pV P                  VP	                  4       V P
                  4       \         P                  ! V P                  4      pV P                  VP	                  4       V P
                  4       \         P                  ! V P                  RRR7      pV P                  VP	                  4       V P
                  4       V P                  \        \         P                  R4       V P                  \        \         P                  V P                  RR7       R# )ztest from_string() constructorutf-8mypolicyr:   sectionencodingNfakesectionra   )r   from_stringsample_1_unicoderS   rT   rU   sample_1_unnormalizedencodesample_1b_unicodesample_1c_bytesassertRaises	TypeErrorr   rY   s   & r&   test_02_from_string$CryptContextTest.test_02_from_string   s]    &&t'<'<=(:(:; &&t'A'AB(:(:; &&t'<'<'C'CG'LM(:(:; &&t'='=>(:(:; &&t';';Z.68(:(:; 	)\%=%=tD 	.,*B*B// 	 	Hr(   c                N   \         P                  P                  V P                  4      '       g   \	        RV P                  ,          4      h\
        P                  ! V P                  4      pV P                  VP                  4       V P                  4       \
        P                  ! V P                  4      pV P                  VP                  4       V P                  4       \
        P                  ! V P                  RRR7      pV P                  VP                  4       V P                  4       V P                  \        \
        P                  \         P                  P                  \        R4      4       V P                  \         \
        P                  V P                  RR7       R# )	ztest from_path() constructorzcan't find data file: %rr_   r:   r`   zsample1xxx.cfgrc   rd   N)ospathexistssample_1_pathRuntimeErrorr   	from_pathrS   rT   rU   sample_1b_pathsample_1c_pathrk   EnvironmentErrorjoinherer   rY   s   & r&   test_03_from_path"CryptContextTest.test_03_from_path   s1    ww~~d00119D<N<NNOO $$T%7%78(:(:; $$T%8%89(:(:; $$T%8%8*.68(:(:; 	*L,B,B'',,t-=>	@ 	.,*@*@,,m 	 	Er(   c                F   \        R/ V P                  B pVP                  ! R/ V P                  B pV P	                  VP                  4       V P                  4       V P	                  VP                  4       V P                  4       VP                  ! R/ V P                  B pV P	                  VP                  4       V P                  4       V P	                  VP                  4       V P                  4       VP                  ! R/ V P                  B pV P	                  VP                  4       V P                  4       VP                  4       pV P                  WQ4       V P	                  VP                  4       V P                  4       V P	                  VP                  4       V P                  4       VP                  ! R/ V P                  B  V P	                  VP                  4       V P                  4       V P	                  VP                  4       V P                  4       R# )ztest copy() methodNrR   )r   rU   r   rW   rS   rT   sample_12_dictrX   sample_123_dictassertIsNotr    )rN   cc1cc2cc2bcc3cc4s   &     r&   test_04_copyCryptContextTest.test_04_copy  s   0T//0 hh,++,(:(:;(;(;< xx-$,,-(:(:;)<)<= hh,++,(<(<= hhj"(:(:;(:(:; 	

(T''((:(:;(;(;<r(   c                f    \        R/ V P                  B pV P                  \        V4      R4       R# )ztest repr()z!^<CryptContext at 0x-?[0-9a-f]+>$NrR   )r   rU   assertRegexrepr)rN   r   s   & r&   test_09_reprCryptContextTest.test_09_repr+  s*    0T//0c$GHr(   c                   \        4       pVP                  V P                  4       V P                  VP	                  4       V P                  4       VP                  V P
                  4       V P                  VP	                  4       V P                  4       VP                  V P
                  P                  R4      4       V P                  VP	                  4       V P                  4       V P                  \        VP                  R4       \        R/ V P                  B pVP                  / RR7       V P                  VP	                  4       V P                  4       \        4       pVP                  V P                  4       VP                  V P                  4       V P                  VP	                  4       V P                  4       R# )z test load() / load_path() methodr^   NT)r    rR   )
r   loadrU   rS   rT   rf   rh   rk   rl   rW   rY   s   & r&   test_10_loadCryptContextTest.test_10_load4  sH    n 	##$(:(:; 	&&'(:(:; 	&&--g67(:(:; 	)SXXt4 0T//0D!(:(:; n##$##$(:(:;r(   c                   \        RR.RRR7      pVP                  4       pV P                  \        VP                  RR7       V P                  VP                  4       V4       V P                  \        VP                  RR7       V P                  VP                  4       V4       V P                  \        VP                  R	R
7       V P                  VP                  4       V4       R# )z$test load() errors restore old stater+   r=   i  r.   )rE   r2   T)too__many__key__parts)fake_context_optioni'  rD   N)r   	to_stringrk   rl   r    rS   KeyError
ValueError)rN   ccresults   &  r&   test_11_load_rollback&CryptContextTest.test_11_load_rollback_  s     ;7)-   	)RYYdK0
 	(BII4H0 	*bii%P0r(   c                   \        R/ V P                  B pVP                  4        V P                  VP	                  4       V P                  4       \        R/ V P                  B pVP                  ! R/ V P
                  B  V P                  VP	                  4       V P                  4       VP                  ! R/ V P                  B  V P                  VP	                  4       V P                  4       \        R/ V P                  B pVP                  V P
                  4       V P                  VP	                  4       V P                  4       \        R/ V P                  B pVP                  V P                  4       V P                  VP	                  4       V P                  4       V P                  \        VP                  / / 4       V P                  \        VP                  / R.R7       V P                  \        VP                  R4       R# )ztest update() methodr+   r7   NrR   )r   rU   r    rS   rT   rW   r~   rX   r   sample_2_unicoderk   rl   rY   s   & r&   test_12_updateCryptContextTest.test_12_updatew  s    0T//0

(:(:; 0T//0

(T''((;(;< 	

(T''((<(<= 0T//0

4%%&(;(;< 0T//0

4(()(;(;< 	)SZZR8)SZZk]K 	)SZZ6r(   c                   R pV P                  \        \        RR7       V P                  \        \        RR7       V P                  \        \        RR7       V P                  \        \        RR7       V P                  \        \        RR7       V P                  \        \        R	R
7       V P                   ! \        V3/ RR/B  \        R'/ RRRR/B pV P	                  VP                  R4      R4       \        RR7      pV P	                  V! RR7      V4       V P	                  V! RR7      V4       V P	                  V! RR7      V4       V P	                  V! R'/ RR/B V4       V P	                  V! R'/ RR/B V4       \        RR7      pV P	                  V! RR7      V4       V P	                  V! R'/ RR/B V4       \        RR7      pV P	                  V! RR7      V4       V P	                  V! RR7      V4       V P	                  V! R'/ RR/B V4       V P	                  V! R'/ RR/B V4       \        RR7      pV P	                  V! RR7      V4       V P	                  V! R'/ RR/B V4       \        RR.R R!7      pV P                  \        VP                  R R"7       V P                  \        \        R.R#R$7       V P                  \        \        R.R#R%7       R&# )(ztest basic option parsingc                  4    \        R/ V B P                  4       # )NrR   r   rT   )r#   s   ,r&   parse/CryptContextTest.test_20_options.<locals>.parse  s    '$'//11r(   r.   )__x)default__scheme__)__option)default____option)__scheme__optioni0u  )!category__scheme__option__invalidzadmin.context__schemesr,   r0   md5_crypt,des_cryptzadmin.context__defaultr+   adminr<   )context__default)default__context__defaultzcontext.defaultzdefault.context.defaultadmin__context__defaultzadmin.context.defaultr2   )default__all__vary_roundszall.vary_roundszdefault.all.vary_rounds)admin__all__vary_roundszadmin.all.vary_roundsphpassP)rF   )md5_crypt__identxx)r0   des_crypt__salt)r0   	all__saltNrR   )rk   rl   r   r   rS   default_schemedictr   )rN   r   rZ   r   s   &   r&   test_20_options CryptContextTest.test_20_options  s   	2 	)\c:)\SI 	)\C@)\SI 	)\CH 	)\>C 	 	E
 	(E 	D5kB	D Ei(=6{D E++G4kB k*{3V<<fEEvNA"3K!@A6JI";K!HI6R k:{CVLG"9+!FGP s+4f==vF9"3C!896BA";C!@A6J c2s;VD?"9#!>?H Hk2#F(CHHsC 	(L;-BF 	 	H(L;-<@ 	 	Br(   c                   \        RR7      pV P                  VP                  4       R4       \        RR.R7      pV P                  VP                  4       R4       \        RR7      pV P                  VP                  4       R4       \        \        P                  \        P
                  .R7      pV P                  VP                  4       R4       V P                  \        \         \        P                  .R7        ! R R\        P                  4      pV P                  \        \         V.R7        ! R R	\        P                  4      pV P                  \        \         W3.R7       V P                  \        \         R.R
7       R# )z%test 'schemes' context option parsingNr7   r+   r,   z des_crypt, md5_crypt, c                       ] tR tRtRtRtR# )2CryptContextTest.test_21_schemes.<locals>.namelessi  NrR   __name__
__module____qualname____firstlineno__name__static_attributes__rR   r(   r&   namelessr     s    Dr(   r   c                       ] tR tRtRtRtR# )1CryptContextTest.test_21_schemes.<locals>.dummy_1i  dummy_1rR   Nr   rR   r(   r&   r   r     s    Dr(   r   )admin__context__schemesrR   )r+   r,   )r   rS   r0   r   r+   r,   rk   rl   uhStaticHandlerr   r   )rN   r   r   r   s   &   r&   test_21_schemes CryptContextTest.test_21_schemes  s2    $'r* ;"<='AB ";<'AB 4>>4>>"BC'AB 	)\B<L<L;MN	r'' 	*lXJG	b&& 	(L7:LM 	(L3>- 	 	Ar(   c                   RR lp\        R.R7      pVP                  RR.R7       V P                  V! V4      R.4       \        R.RR.R7      pV P                  V! V4      R.4       V P                  \        \         \
        P                  .RR.R7       \        R. ROR7      pV P                  V! V4      RR.4       V P                  \        \         R.R.R	7       V P                  \        \         R.R.R	7       V P                  \        \         RR.RR.R
7       V P                  \        \         RR.RRR7       V P                  \        \         RR.RRR7       V P                  \        \         RR.RRR7       V P                  \        \         RR.RRR7       \        RR.RR. R7       V P                  \        \         ^{R7       \        R.RR.R.R7      pV P                  V! V4      R.4       V P                  V! VR4      R.4       V P                  V! VR4      R.4       \        R.RR.. R7      pV P                  V! V4      R.4       V P                  V! VR4      R.4       V P                  V! VR4      . 4       R# )z(test 'deprecated' context option parsingNc                     V P                  4        Uu. uF(  pV P                  W!4      P                  '       g   K&  VNK*  	  up# u upi r   r0   handlerrA   )rZ   categoryr   s   && r&   getdep3CryptContextTest.test_22_deprecated.<locals>.getdep  s?    %([[] ?]T{{42== D] ? ? ?s
   #AAr,   rA   r+   r7   )rA   r0   r   r0   rA   )r0   admin__context__deprecated)r0   r1   rA   )r0   r1   r   )r0   r   rA   )r0   r   r   )r0   rA   r   r   )rA   r0   r   userr   r   )r,   r+   r=   )	r   r    rS   rk   rl   r   r,   r   r   )rN   r   r   s   &  r&   test_22_deprecated#CryptContextTest.test_22_deprecated  s   	?
 k]3
		;4	5[M2 k][+<VWk]3 	)\t~~>N#."< 	 	> %:Dnok;%?@ 	(L;->I] 	 	L 	*l#.-&1] 	 	4 	*l#."<6A;5O 	 	Q 	*l#."<"-%0 	 	2 	*l#."<"-5@ 	 	B 	*l#."<2=%0 	 	2 	*l#."<2=5@ 	 	B 	#."<%02=57		9 	)\cB k]#."<6A] 	k]3F+k];G,{m< k]#."<57 	k]3F+k];G,b1r(   c                ^   V P                  \        RR7      P                  4       \        RR7      4       \        RRR.R7      pV P                  VP	                  4       R4       \        \
        P                  RR.R7      pV P                  VP	                  4       R4       \        RR.R7      pV P                  VP	                  4       R4       VP                  RR7       V P                  VP	                  4       R4       V P                  \        \        R.RR7       V P                  \        \        ^R7       \        RRR.RR7      pV P                  VP	                  4       R4       V P                  VP	                  R	4      R4       V P                  VP	                  R
4      R4       R# )z%test 'default' context option parsingr,   r<   r+   )r1   r0   r7   r   )r0   r1   )r1   r0   r   r   r   N)rS   r   rT   r   r   r   r,   r    rk   r   rl   rY   s   & r&   test_23_default CryptContextTest.test_23_defaulth  sz    	k:BBDk2	4 ;k8RS++-{; 4>>K;UV++-{; K#=>++-{;

k
*++-{; 	(L;-:E 	 	G 	)\1= ;$/#=3>@ 	++-{;++F3[A++G4kBr(   c                    R pV P                  V! R4      R4       V P                  V! R4      R4       V P                  V! R4      R4       V P                  V! R4      R4       V P                  V! R4      R4       R# )z&test 'vary_rounds' hash option parsingc                 D    \        V R 7      P                  4       R,          # )r   r2   r   )vs   &r&   r   3CryptContextTest.test_24_vary_rounds.<locals>.parse  s    3;;=>PQQr(   r.   z0.1z10%i  1000N)rS   )rN   r   s   & r&   test_24_vary_rounds$CryptContextTest.test_24_vary_rounds  sr    	R 	sS)us+ 	us+ 	td+v-r(   Nc                >    V P                  \        W4      VR 7       R# ))msgN)
assertTruer   )rN   r   baser   s   &&&&r&   assertHandlerDerivedFrom)CryptContextTest.assertHandlerDerivedFrom  s    ,W;Er(   c                   \        4       pV P                  VP                  4       R4       V P                  VP                  RR7      R4       \        R/ V P                  B pV P                  VP                  4       \	        V P
                  4      4       V P                  VP                  RRR7      \	        V P                  4      4       \        VP                  RR7      V P                  4       F  w  r#V P                  \        W#4      4       K!  	  \        R/ V P                  B pV P                  VP                  4       R4       R# )ztest schemes() methodTresolver   unconfiguredNrR   )r   rS   r0   rU   tuplesample_1_schemessample_1_handlerszipr   r   rW   )rN   rZ   r   corrects   &   r&   test_30_schemes CryptContextTest.test_30_schemes  s    
 n+T2B7 0T//0d.C.C(DETEuTMcMcGde"3;;t;#<d>T>TUOFOO0AB  V 0T//0+r(   c                \   \        4       pV P                  \        VP                  4       \        R/ V P                  B pV P                  VP                  4       R4       V P                  VP                  RRR7      \        P                  4       V P                  VP                  RR7      \        P                  4       \        R/ V P                  B pV P                  \        VP                  4       \        V P                  R7      pV P                  VP                  4       R4       R# )	ztest default_scheme() methodr,   Tr   r   r7   r+   NrR   )r   rk   r   r   rU   rS   r   r,   r   rW   r   rY   s   & r&   test_31_default_scheme'CryptContextTest.test_31_default_scheme  s    
 n(C$6$67 0T//0++-{;++Dt+Ldnn]%%c&8&8&8&FW 0T//0(C$6$67 4#8#89++-{;r(   c                   \        4       pV P                  \        VP                  4       V P                  \        VP                  R4       \        R/ V P                  B pV P                  VP                  RR7      \        P                  4       V P                  VP                  4       \        P                  4       V P                  VP                  RRR7      \        P                  4       V P                  VP                  R4      \        P                  4       V P                  \        VP                  R4       \        RRR7      pV P                  VP                  RR7      \        P                  4       V P                  VP                  4       \        P                  4       V P                  VP                  RRR	7      \        P                  4       V P                  VP                  RR
7      \        P                  4       V P                  VP                  RRR	7      \        P                  4       V P                  VP                  RR
7      \        P                  4       \        '       dw   V P                  VP                  \        R4      RR	7      \        P                  4       V P                  VP                  \        R4      RR	7      \        P                  4       R# R# )ztest handler() methodr,   T)r   r+   mysql323sha256_crypt,md5_cryptr   staff)r   r   r   r   NrR   )r   rk   r   r   rU   rS   r   r,   r   r+   r=   r   r   rY   s   & r&   test_32_handler CryptContextTest.test_32_handler  s	    n(CKK0(CKK= 0T//0$7H%%ckkmT^^D 	[tDdnnU%%ckk+&>O 	(CKK< 3[Y$79J9JK%%ckkmT5F5FGgDI4K\K\]%%ckk7k&CTEVEVWgDI4>>Z%%ckk7k&CTEVEVW 3S[[!G*4[PRVRcRcdS[[!G*4[PRVR`R`a r(   c                &   RR lp\        R. RORR.RRR	RR.R
RRR7
      pV P                  VP                  P                  R4       V P                  V! VR4      \	        RRR	R7      4       V P                  V! VRR4      \	        RRR	R7      4       V P                  V! VRR4      \	        R
RR7      4       V P                  V! VR4      \	        RRR7      4       V P                  V! VRR4      \	        RRR7      4       V P                  V! VRR4      \	        RRR7      4       V P                  V! VR4      \	        RR7      4       V P                  V! VRR4      \	        RR7      4       V P                  V! VRR4      \	        RRR7      4       R# )z*test internal _get_record_options() methodNc                 F    V P                   P                  W4      ^ ,          # )    )_config_get_record_options_with_flag)rZ   schemer   s   &&&r&   options1CryptContextTest.test_33_options.<locals>.options  s    ;;<<VNqQQr(   Tr-   r+   
bsdi_cryptr.   皙?i N  皙?g333333?r/   )
truncate_errorr0   rA   r2   rB   r5   r   r   admin__bsdi_crypt__vary_roundsadmin__sha512_crypt__max_roundsr   )rA   vary_rounds
max_roundsr   )r  r  )rA   r  )r  )r  rA   r   )r-   r+   r  )r   )r   rS   r  
categoriesr   )rN   r  r   s   &  r&   test_33_options CryptContextTest.test_33_options  s   	R
 B(+6"$'',+6)F&*+..3
 	//< 	n5t8
 	 	nf=t@
 	 	ng>A
 	 	k2D5
 	
 	k6:D=
 	
 	k7;T>
 	 	l3T6
 	 	lF;T>
 	 	lG<d?
 	r(   c                    \        R/ V P                  B pV P                  VP                  4       V P                  4       V P                  VP                  RR7      V P                  4       R# )ztest to_dict() methodTr   NrR   )r   rU   rS   rT   rV   rY   s   & r&   test_34_to_dict CryptContextTest.test_34_to_dictC  sT     0T//0(:(:;T2D4O4OPr(   c                   \        R	/ V P                  B pVP                  4       p\        '       g   V P	                  W P
                  4       \         P                  ! V4      pV P	                  VP                  4       V P                  4       VP                  RR7      pV P	                  WBP                  RR4      4       ^ RI	H
p \        VR.4      pVP                  4       pV P                  VR4       R# )
ztest to_string() methodzpassword-securityrd   r9   z[password-security])UnsaltedHashr,   zM# NOTE: the 'unsalted_test_hash' handler\(s\) are not registered with PasslibNrR   )r   rU   r   r   rS   rf   re   rT   replace!passlib.tests.test_utils_handlersr  r   )rN   rZ   dumpctx2otherr  ctx3s   &      r&   test_35_to_string"CryptContextTest.test_35_to_stringJ  s     0T//0}} tT#8#89 ''-););< &9:[9N OP 	C\;78~~  C 	Dr(   r
  c           	        \         P                  \         P                  \         P                  .p\	        V^R7      pV F  pVP                  RVP
                  R7      pV P                  VP                  V4      VP
                  4       V P                  VP                  VRRR7      V4       V P                  VP                  VRR7      V4       V P                  VP                  RV4      4       V P                  VP                  RV4      4       K  	  VP                  R4      pV P                  VP                  V4      R4       VP                  R	VP                  4       4      pV P                  VP                  V4      R4       VP                  R	VP                  4       RR7      pV P                  VP                  V4      R4       V P                  \        VP                  R	VP                  4       R
R7       R# )z-test basic hash/identify/verify functionalityr4   testr
  Tr   r   notestr,   secretr+   N)r   r,   r+   r  r   r   rS   identifyr   r   verifyassertFalsegenhash	genconfigrk   r   )rN   handlersr   crypths   &    r&   test_40_basicCryptContextTest.test_40_basicq  s}   NNDNNDOOD(qA Euzz2AR[[^UZZ8R[[Dt[LeT))"++a+*FNOOBIIfa01RYYx34  GGFOQ5 JJx0Q5JJxJDQ5*bjj(BLLNS^_r(   c           	        \        RR.R^RR7      pV P                  VP                  4       P                  R4      4       V P                  VP                  RR7      P                  R4      4       V P                  VP                  RR	R
7      P                  R4      4       V P                  VP                  RRR
7      P                  R4      4       V P	                  VP                  RR^RR7      R4       \
        '       d   VP                  RR7      pV P                  VP                  \        R	4      R7      P                  R4      4       V P                  VP                  \        R4      R7      P                  R4      4       V P                  \        \        4       P                  4       V P                  \        \        4       P                  RR7       V P                  \        VP                  RR7       V P                  \        VP                  ^RR
7       V P                  \        VP                  ^R7       V P                  \        VP                  ^R7       R# )ztest genconfig() methodr,   r   r@   r   )r0   rF   rG   admin__phpass__identz$1$r(  z$H$5r   )r
  r   z$P$5r  )r
  saltroundsidentz"$P$6........22zGEuacuPOqEpYPDeR0R/r<   r  fakeN........)r   r   r/  
startswithrS   r   r   r   rk   r   rl   rN   r   c2s   &  r&   test_41_genconfig"CryptContextTest.test_41_genconfig  s   ;"9(+12/2 	11%89 	H5@@HI 	HwGRRSYZ[HwGRRSYZ[ 	LLuQcLJ0	 3*BOOBLL!G*L=HHPQOOBLL!G*L=HHPQ 	(LN$<$<=(LN$<$<[Q 	(BLL@)R\\!gN)R\\!< 	)R\\A>r(   c                   \        R.4      pVP                  R4      pV P                   F(  w  r4V P                  ! \        VP
                  W23/ VB  K*  	  \        R.4      pV P                   F/  w  rTVf   K  V P                  ! \        VP
                  RV3/ VB  K1  	  \        R.4      pV P                  \        VP
                  RR4       V P                  \        \        4       P
                  RR4       V P                  \        VP
                  RVRR7       V P                  \        VP
                  RV^R7       V P                  \        VP                  RV^R	7       R# )
ztest genhash() methodr+   stubNr*  r   r   r:  r(  r  )r   r   nonstring_vectorsrk   rl   r.  r   r/  )rN   r   r   r*  r#   configs   &     r&   test_42_genhash CryptContextTest.test_42_genhash  s0    ;-(wwv 22LFiVJTJ 3 ;-( 22LF| iXvNN 3 :,')RZZ> 	(LN$:$:HfM 	(BJJ$vN)RZZ4J 	)R\\8TANr(   c                |   \        R
/ V P                  B pVP                  R4      pV P                  VP                  ! R4      4       V P                  VP                  RV4      4       V P                  VP                  RV4      4       V P                  \        VP                  RR7       \        R.4      pV P                   F(  w  r4V P                  ! \        VP                  V3/ VB  K*  	  V P                  \        \        4       P                  R4       V P                  \        VP                  R^R7       R	# )ztest hash() methodpasswordz$5$rounds=3000$	passwordxi  rE   r+   r*  r  NrR   )r   sample_4_dictr   r   r<  r,  r-  rk   r   r   rC  rl   r   )rN   r   r   r*  r#   s   &    r&   test_43_hashCryptContextTest.test_43_hash  s     /D../wwz"(9:;		*d34;56 	*bgg7; 	 	= ;-( 22LFi&ADA 3 	(LN$7$7B 	)RWWhCr(   c                   \        R/ V P                  B pV P                  R.4      ;_uu_ 4        V P                  VP	                  RRRR7      R4       RRR4       V P                  R.4      ;_uu_ 4        V P                  VP	                  RRRRR7      R	4       RRR4       V P                  R.4      ;_uu_ 4        V P                  VP	                  RR
RR7      R4       RRR4       V P                  R.4      ;_uu_ 4        V P                  VP	                  RRRR7      R4       RRR4       V P                  \        VP                  RRR7       V P                  \        VP                  R^R7       R#   + '       g   i     EL/; i  + '       g   i     L; i  + '       g   i     L; i  + '       g   i     L; i)z;test hash() method -- legacy 'scheme' and settings keywords"passing settings to.*is deprecatedrH  r   )r
  r7  z"$H$5........De04R5Egz0aq8Tf.1eVhY/Nr   )r
  r7  r9  z"$P$5........De04R5Egz0aq8Tf.1eVhY/  naclr8  r7  z?$5$rounds=1999$nacl$nmfwJIxqj0csloAAvSER0B8LU0ERCAbhmMug4Twl609  z?$5$rounds=2001$nacl$8PdeoPL4aXQnJ0woHhqgIw/efyfCKC2WHneOpnvF.31r*  r:  r(  rR   r;  )r   rK  assertWarningListrS   r   rk   r   rl   )rN   use_16_legacyr   s   && r&   test_43_hash_legacy$CryptContextTest.test_43_hash_legacy  sz   /D../  ##%I$JKK
8%@4 L
 ##%I$JKK
8%sK4 L ##%I$JKK
4f=Q L ##%I$JKK
4f=Q L 	(BGGXfE)RWWhqA; LKK
 LK LK LKs/   %E;7&F?%F"%F5;F	F	"F2	5G	c                   . R	Op\        V^R7      pV P                  VP                  R4      R4       V P                  \        VP                  RRR7       \        R.4      pV P
                   F(  w  r4V P                  ! \        VP                  V3/ VB  K*  	  \        4       pV P                  VP                  R4      R4       V P                  \        VP                  RRR7       V P                  \        VP                  R^R7       R# )
ztest identify() border casesr+   r&  z$9$232323123$1287319827NT)requiredr   r  r,   r+   r  )	r   rS   r+  rk   r   rC  rl   assertIsr   )rN   r0  r   r   r#   s   &    r&   test_44_identify!CryptContextTest.test_44_identify.  s    ;(qA 	%>?F*bkk3LW[\ ;-(00JDidCdC 1 ^bkk&)40(BKK$G 	)R[[$Cr(   c                   . ROp\        V^R7      p\        P                  P                  R4      pV P                  VP	                  RV4      4       V P                  VP	                  RV4      '       * 4       V P                  VP	                  RVRR7      4       V P                  VP	                  RVRR7      '       * 4       V P                  \        VP                  RVRR7       V P                  \        VP                  RR	4       \        R.4      pVP                  R4      ;r4V P                   F(  w  rVV P
                  ! \        VP                  WS3/ VB  K*  	  V P                  VP	                  XR
4      4       \        R.4      pV P                   F/  w  r6Vf   K  V P
                  ! \        VP                  RV3/ VB  K1  	  V P                  \        \        4       P                  RR4       V P                  \        VP                  RVRR7       V P                  \        VP                  RV^R7       V P                  \        VP                  RV^R7       R
# )ztest verify() scheme kwdr,   r+   r  r&  r'  r)  r(  rB  z$6$232323123$1287319827Nr*  r   r:  r  rZ  )r   r   r,   r   r,  rk   r   rC  rl   r-  r   )rN   r0  r   r2  refhashr*  r#   s   &      r&   test_45_verifyCryptContextTest.test_45_verifyH  s   ;(qANN' 			&!,-BIIh223 			&!K	@ABIIh+IFFG 	*bii<P 	*bii9RS ;-(ggfo% 22LFiFFF 3 	6401 ;-(--GAyiHaH4H . 	(LN$9$98VL 	(BIIxP)RYY'!L 	)RYY'ANr(   c                .  a \        R/ V P                  B pV P                  VP                  R4      4       V P	                  VP                  R4      4       V P                  VP                  R4      4       V P	                  VP                  R4      4       V P	                  VP                  R4      4       V P                  VP                  R4      4       . o ! V3R lR\
        P                  4      p\        V.4      pVP                  R	4      ;rEV P	                  VP                  V4      4       V P                  SVR
3.4       SR V P	                  VP                  VRR7      4       V P                  SVR3.4       SR V P                  VP                  VRR7      4       V P                  SVR3.4       SR \        R.4      pV P                   F(  w  rFV P                  ! \        VP                  V3/ VB  K*  	  V P                  \        \        4       P                  R4       V P                  \        VP                  VRR7       V P                  \        VP                  V^R7       V P                  \        VP                  V^R7       R
# )ztest needs_update() method9XXD4trGYeGJAz"$1$J8HC2RCr$HcmM.7NxB2weSvlw2FgzU0zK$5$rounds=1999$jD81UCoo.zI.UETs$Y7qSTQ6mTiU9qZB4fRr43wRgQq4V.5AAf7F97Pzxey/zK$5$rounds=2000$228SSRje04cnNCaQ$YGV4RYu.5sNiBvorQDlO0WWQjyJVGKBcJXz3OtyQ2u8zK$5$rounds=3000$fS9iazEwTKi7QPW4$VasgBC8FqlOvD7x2HhABaMXCTh9jwHclPA9j5YQdns.zK$5$rounds=3001$QlFHHifXvpFX4PLs$/0ekt7lSs/lOikSerQ0M/1porEHxYq7W/2hdFpxA3fAc                   J   <a  ] tR tRt o RtRt]RV3R ll4       tR tRt	V t
R# )	4CryptContextTest.test_46_needs_update.<locals>.dummyi  dummy@Nc                2   < SP                  W34       VR 8H  # )nu)append)clsr   r*  check_states   &&&r&   needs_updateACryptContextTest.test_46_needs_update.<locals>.dummy.needs_update  s    ""D>2~%r(   c                    ^ RI Hp \        V\        4      '       d   VP	                  R4      p\        V! V4      P                  4       4      # )r  )md5r^   )hashlibrp  
isinstancer   rh   r   	hexdigest)rN   r*  rp  s   && r&   _calc_checksumCCryptContextTest.test_46_needs_update.<locals>.dummy._calc_checksum  s8    'fg..#]]73F$S[%:%:%<==r(   rR   r   )r   r   r   r   r   _hash_prefixclassmethodrm  rt  r   __classdictcell__)__classdict__rl  s   @r&   rf  re    s+     DL& &> >r(   rf  r'  N:NNNbob)r*  ri  r+   r   r:  r(  r  rR   )r   rK  r   rm  r-  r   r   r   rS   rC  rk   rl   r   )rN   r   rf  rZ   r   r_  r#   rl  s   &      @r&   test_46_needs_update%CryptContextTest.test_46_needs_update{  s7   /D../ 	89)MNO 	(uvw)vwx 	)vwx(uvw
 	>B$$ 	>  E7#F++))$/0T{m4N 	))$u)=>U|n5N 	((d(;<T{m4N ;-(00JDi$G$G 1 	(LN$?$?H 	(BOOWVL)R__gaH 	)R__gJr(   c                8   \        R/ V P                  B pVP                  R4      P                  R4      pVP                  R4      P                  R4      pVP	                  RV4      w  rEV P                  V4       V P                  VR4       VP	                  RV4      w  rEV P                  V4       V P                  VR4       VP	                  RV4      w  rEV P                  V4       V P                  VP                  V4      R4       VP	                  RV4      w  rEV P                  V4       V P                  VR4       \        R.4      pVP                  R4      ;rgV P                   F(  w  rV P                  ! \        VP                  W3/ V	B  K*  	  V P                  VP	                  XR4      R4       \        R.4      pV P                   F/  w  riVf   K  V P                  ! \        VP                  RV3/ V	B  K1  	  V P                  \        \        4       P                  RR4       V P                  \        VP                  RVR	R
7       V P                  \        VP                  RV^R
7       V P                  \        VP                  RV^R7       R# )ztest verify_and_update()r+   rH  r=   	wrongpassNrB  r*  r   r:  r(  r  rR   FN)r   rK  r   r   verify_and_updater-  r[  r   r+  rC  rk   rl   rS   r   )
rN   r   h1h2oknew_hashr   r_  r*  r#   s
   &         r&   test_47_verify_and_update*CryptContextTest.test_47_verify_and_update  sM   /D../ ZZ$))*5ZZ',,Z8 ++K<h% ++K<h% ++J;H-~> ++J;h% ;-(( 22LFi)=)=vTtT 3 	--fd;]K ;-(00JD|i)=)=xVQUV 1 	(LN$D$DhPVW 	(B$8$8(GTZ[)R%9%98WUVW 	)R%9%98WWXYr(   c           	     ,	   ^ RI HpHpHp VP	                  R4      pVP	                  RRR7      pVP	                  RRR7      p\        W.4      pV P                  VP                  \        4       4       V P                  VP                  VP	                  R4      4      R4       V P                  VP                  RV4      4       V P                  VP                  RV4      R4       V P                  R	.4      ;_uu_ 4        V P                  \        VP                  RRR7       RRR4       V P                  \        VP                  RVRR7       V P                  \        VP                  RVRR7       \        W.4      pV P                  VP                  \        R
.4      4       V P                  VP                  VP	                  R4      4      R4       V P                  VP                  RV4      4       V P                  VP                  RV4      R4       V P                  VP                  VP	                  RRR7      4      R4       V P                  VP                  RVRR7      4       V P                  VP                  RVRR7      R4       V P                  R	.4      ;_uu_ 4        V P                  \        VP                  RRR7       RRR4       V P                  \        VP                  RVRR7       V P                  \        VP                  RVRR7       \        W1.RR7      p	V P                  V	P                  \        R
.4      4       V P                  \        V	P                  R4       V P                  \        V	P                  RV4       V P                  \        V	P                  RV4       V P                  V	P	                  RRR7      V4       V P                  V	P                  RVRR7      4       V P                  V	P                  RVRR7      R4       V P                  V	P                  RVRR7      R4       V P                  V	P                  RVRR7      RV34       R#   + '       g   i     ELT; i  + '       g   i     EL; i)zLhash(), verify(), and verify_and_update() -- discard unused context keywords)r+   r,   postgres_md5rB  root)r   r   r+   TNrO  r   )badkwdautor   )TNr  )passlib.hashr+   r,   r  r   r   rS   context_kwdssetr   r+  r,  r  rT  rk   rl   )
rN   r+   r,   r  des_hashpg_root_hashpg_admin_hashr   r   r   s
   &         r&   test_48_context_kwds%CryptContextTest.test_48_context_kwds  s   
 	DC>>&)#((f(=$))&w)?
 I12))351 		**388F+;<kJ

6845..vx@,O ##%I$JKKi6G L)SZZO)S%:%:FHSYZ
 I45))3x=9 		**388F+;<kJ

6845..vx@,O 		**388F8+HI;W

68&
AB..vxf.M|\ ##%I$JKKi6&I L)SZZ&Q)S%:%:FHU[\
 L4H))3x=9 	)SXXv6)SZZF)S%:%:FLQ 	&v6E

6<f
EF..v|&.QS_` 	..v|'.RTab 	..vxf.M-	/_ LKK, LKKs   ?$Q.+$R.Q?	R	c           	     
   \        R.RRRR7      pRpVP                  RR4      pV P                  VP                  R4       V P                  VP                  R4       V P                  VP
                  R4       V P                  \        .^,          4      ;_uu_ 4        VP                  RRRR	7      pRRR4       V P                  XP                  R
R7      RV,           4       V P                  . 4      ;_uu_ 4        V P                  VP                  RR
R7      RV,           4       RRR4       V P                  VP                  RR
R7      RV,           4       V P                  VP                  RR
R7      RV,           4       V P                  \        .^,          4      ;_uu_ 4        VP                  \        R4      R,           R\        R4      R,           R7      pRRR4       V P                  VP                  R
R7      RV,           4       V P                  . 4      ;_uu_ 4        V P                  VP                  RR
R7      RV,           4       RRR4       V P                  VP                  RR
R7      RV,           4       V P                  VP                  RR
R7      RV,           4       V P                  VP                  R
R7      RV,           4       \        P                  P
                  pVP                  RV^,          R7      pV P                  VP                  R
R7      RWR3,          4       VP                  RRR7      pV P                  VP                  R
R7      RV,           4       V P                  \        VP                  RR7       VP                  RR7       VP                  RR7       V P                  \        VP                  RR7       \        R.R7      pV P                  \        VP                  RRR 7       V P                  \        \         R!R"7       V P                  \        \         R!R#7       V P                  \        \         R!R$7       V P                  \        \         R!R7       \        P                  P!                  4       pV P                  \"        \         RVR"7       V P                  \"        \         RVR#7       V P                  \"        \         RVR$7       V P                  \"        \         RVR7       R#   + '       g   i     ELd; i  + '       g   i     EL; i  + '       g   i     ELa; i  + '       g   i     EL ; i)%ztest rounds limitsr=   r?   r>   i	  r0   rD   rC   rE   z+...........................................Ni  )rD   rC   rE   rQ  r7  z$5$rounds=1000$nacl$rP  rR  z$5$rounds=1999$nacl$z$5$rounds=2000$nacl$rS  z$5$rounds=2001$nacl$g    eA)rC   rD   rE   z$5$rounds=999999999$nacl$i  z$5$rounds=3001$nacl$z$5$rounds=3000$nacl$i  z$5$rounds=2999$nacl$z$5$rounds=2500$nacl$)rE   rC   z$5$rounds=%d$nacl$%srJ  r7   )rD   rC   r   r   )rC   r   )r   _get_recordrS   min_desired_roundsmax_desired_roundsdefault_roundsrT  r
   r   r/  intr   r=   rk   r   datetimenowrl   )rN   r   STUBcustom_handlerr>  dfbads   &      r&   test_50_rounds_limits&CryptContextTest.test_50_rounds_limitsQ  s   >"237377; = =::DA::DA66= ##%7$8$:;;#PT9<  >B < 	624JT4QR ##B''Dv68NQU8UW (
 	LL6L24JT4Q	S 	LL6L24JT4Q	S ##%7$8$:;;#c(3,Y]9<S#  GB < 	624ORV4VW ##B''Dv68NQU8UW (
 	LL6L24JT4Q	S 	LL6L24JT4Q	S 	624JT4QR --WW$QSUVQVWW624JbZ4WX WW$QUWV624JT4QR
 	*bggDQ
T2
T2*bggDQ >"23 	*bgg37 	 	9 	*lSQ*lSQ*lSI*lQTU ##%)\>\_`)\>\_`)\>TWX)\>`cdw <;; (''" <;; (''s0   T=+T")5T6(+U
T	"T3	6U	
U	c                   \        R.RRRR7      pV P                  \        VP                  RR7       V P                  \        VP                  RR7       V P                  \        VP                  RR7       VP                  ^ R7      pV P	                  VP                  RR	4      P                  ^ 4       V P                  VRRR4       VP                  R
R7      pV P	                  VP                  RR	4      P                  ^ 4       V P                  VRRR4       VP                  ^R7      pV P	                  VP                  RR	4      P                  ^4       V P                  VRRR4       VP                  ^dR7      pV P	                  VP                  RR	4      P                  ^d4       V P                  VRRR4       VP                  RR7      pV P	                  VP                  RR	4      P                  R4       V P                  VRRR4       VP                  RR7      pV P	                  VP                  RR	4      P                  R4       V P                  VRRR4       R	# )ztest linear vary roundsr=   i  i  r?   r  r   -1%101%N0%rP  rS  z0.1%gMbP?i  i  100%      ?r   rk   r   r   rS   r  r  assert_rounds_ranger=  s   &  r&   test_51_linear_vary_rounds+CryptContextTest.test_51_linear_vary_rounds  s   >"237377; 	*bggC*bggF*bggG WWaW(=II1M  ^T4@WWdW+=II1M  ^T4@ WWaW(=II1M  ^T4@WWcW*=II3O  ^T4@ WWfW-=II5Q  ^T4@WWfW-=II3O  ^T4@r(   c                   \        R.^^^R7      pV P                  \        VP                  RR7       V P                  \        VP                  RR7       V P                  \        VP                  RR7       VP                  ^ R7      pV P	                  VP                  RR4      P                  ^ 4       V P                  VR^^4       VP                  RR7      pV P	                  VP                  RR4      P                  ^ 4       V P                  VR^^4       VP                  ^R7      pV P	                  VP                  RR4      P                  ^4       V P                  VR^^4       VP                  ^dR7      pV P	                  VP                  RR4      P                  ^d4       V P                  VR^^4       VP                  RR7      pV P	                  VP                  RR4      P                  R	4       V P                  VR^^4       VP                  R
R7      pV P	                  VP                  RR4      P                  R4       V P                  VR^^4       VP                  RR7      pV P	                  VP                  RR4      P                  R4       V P                  VR^^4       VP                  RR7      pV P	                  VP                  RR4      P                  R4       V P                  VR^^4       R# )ztest log2 vary roundsbcrypt)r0   bcrypt__min_roundsbcrypt__max_roundsbcrypt__default_roundsr   r  r  Nr  z1%g{Gz?z49%g\(\?z50%g      ?r  r  r  r  r=  s   &  r&   test_52_log2_vary_rounds)CryptContextTest.test_52_log2_vary_rounds  s   8*-/-/13 	*bggC*bggF*bggG WWaW($7CCQG  Xr26WWdW+$7CCQG  Xr26 WWaW($7CCQG  Xr26WWcW*$7CCSI  Xr26 WWdW+$7CCTJ  Xr26WWeW,$7CCTJ  Xr26WWeW,$7CCSI  Xr26WWfW-$7CCSI  Xr26r(   c                   VP                  V4      pVP                  R,          VP                  ,          p\        4       p\	        R4       FA  pVP                  W&R7      p	VP                  V	4      P                  p
VP                  V
4       KC  	  V P                  \        V4      VR4       V P                  \        V4      VR4       R# )z2helper to check vary_rounds covers specified range:r     Ni,  r  z"vary_rounds had wrong lower limit:z"vary_rounds had wrong upper limit:N)r   default_salt_charsmax_salt_sizer  r   r/  re   r8  addrS   minmax)rN   contextr
  lowerupperr   r7  seenir2  rs   &&&&&      r&   r  $CryptContextTest.assert_rounds_range  s     //&)))#.1F1FFuA!!&!4A##A&--AHHQK  	TE+OPTE+OPr(   c                   \         P                  ! RR\        R7       \        R.R7      pV P	                  VP
                  R4       V P	                  VP                  RR7      P
                  R4       V P	                  VP                  R	R7      P
                  R4       V P	                  VP                  R
R7      P
                  R4       R# )zharden_verify -- parsingrI   z.*harden_verify.*r  r=   r7   N )harden_verifytruefalse)rL   rM   DeprecationWarningr   rS   r  usingrY   s   & r&   test_harden_verify_parsing+CryptContextTest.test_harden_verify_parsing-  s    *=);	= N#34**D14BBDI8FFM9GGNr(   c                    RpRp\         P                  4       pWn        \        V.R7      pVP	                  4        \        VP                  4      w  rVV P                  WQW,          R7       R# )z
dummy_verify() method
r  r  r7   )deltaN)	DelayHashr  delayr   dummy_verifyr   assertAlmostEqual)rN   expectedaccuracyr   rZ   elapsed_s   &      r&   test_dummy_verify"CryptContextTest.test_dummy_verify9  s_    
 //# G9-s//0
w8KLr(   c                   RR lp\        RRR7      pV P                  V! VR4      . RO4       V P                  V! VR4      . RO4       VP                  RR	7       V P                  V! VR4      . RO4       V P                  V! VR4      . RO4       VP                  R
R7       V P                  V! VR4      . RO4       V P                  V! VR4      . RO4       \        R.RR7      pV P                  V! VR4      R.4       V P                  V! VR4      R.4       V P                  \        \         RRR7       V P                  \        \         RRR7       R# )z+test deprecated='auto' is handled correctlyNc                 |    V P                  4        Uu. uF  q P                  W!4      P                  NK  	  up# u upi r   r   )rZ   r   r
  s   && r&   getstate8CryptContextTest.test_61_autodeprecate.<locals>.getstateP  s-    KN;;=Y=KK1<<=YYYs   #9z sha256_crypt,md5_crypt,des_cryptr  r   Fr   r,   r<   r+   r   r=   r   zauto,md5_cryptzmd5_crypt,autor   )FTT)TFT)TTF)r   rS   r    rk   r   )rN   r  rZ   s   &  r&   test_61_autodeprecate&CryptContextTest.test_61_autodeprecateM  sF   	Z =&Q#$/1DE#w/1DE 	

;
'#$/1DE#w/1DE 	

;
7#$/1DE#w/1DE N+?#$/%9#w/%9 	*l4L%5 	 	7*l4L%5 	 	7r(   c                   ^ RI Hp ^ RIHpHp \        R.4      p\        RR.4      pVP                  R4      pVP                  R4      pV P                  \        RVP                  4       V P                  \        RVP                  V4       V P                  \        RVP                  V4       VP                  4       pV P                  WP                  4       VP                  V4      p	V P                  WP                  V,           4       VP                  V4      p
V P                  WP                  V,           4       V P                  VP                  V	4      V	4       V P                  VP                  V4      4       V P                  WP                  V4       V P                  WP                  V4       V P                  WP                  V	4       V P                  VP                  V4      4       V P                  WP                  V4       V P                  VP                  V4      4       V P                  VP                  V	4      4       V P                  WP                   R4       V P                  \"        VP                   R4       V P                  VP!                  V4      V4       V P                  WP                   V4       V P                  WP                   V4       V P                  WP                   V	4       V P                  WP                   R4       V P                  \"        VP                   R4       V P                  VP!                  V4      V4       V P                  WP                   V4       V P                  \$        R	VP                   V4       V P                  VP!                  V	4      V4       R# )
zdisabled hash support)UnknownHashError)r,   unix_disabledr+   r  foozno disabled hasher presentr  Nzcannot restore original hash)passlib.excr  r  r,   r  r   r   assertRaisesRegexrt   disablerS   default_markerr   
is_enabledrk   r-  enablerl   r   )rN   r  r,   r  rZ   r   h_refh_otherh_dis	h_dis_refh_dis_others   &          r&   test_disabled_hashes%CryptContextTest.test_disabled_hashesm  s   
 	19K=)[/:;..' 	|-I"{{	,|-I"{{E	3|-I"{{G	5  < <=LL'	$@$@5$HIll7+&B&BW&LM 	i0)< 	u-.*NNGD*NNEB*NNIF 	./*NNGD/034 	*JJ;)SZZ6E*E2*JJ@*JJ>*JJ	B 	*JJ;)T[[$7U+U3*KKAz+I#{{E	3Y/7r(   rR   )r+   r,   r  r-   )r+   r,   r   r  r=   r   F)Lr   r   r   r   descriptionPrefixr   r   r   r   rU   r'   rV   r   rg   rf   rp   rq   ry   rz   rs   r  ri   rv   rh   rj   rw   r   rW   r   r~   rX   r   rK  rK   r[   rm   r{   r   r   r   r   r   r   r   r   r   r   r   r   r   r  r  r  r#  rC  r3  r?  rE  rL  rV  r\  r`  r{  r  r  r  r  r  r  r  r  r  r  r   rx  __classcell__)r   rO   ry  s   0@@r&   r*   r*   1   s    & P=MN=MT*40=MN"!&%*#(#(M )3DF  
 
  
 
" GGLL}5M )004!F)DWW\\$7N '..q~/0@@Fx@P WW\\$7N  !&!&%*!&M !>N
 M
 ".-@O
 #"% !#%'"##'#''+!"M$b;6H<E6=:I)<V10 7JJBX"AHZ2x#CJ.(F,(<0"bHM^QDB 
r
	+&'	
B	R	
`6.?b"OHD8/BbD41OfEKN8ZtF/jtel$AL-7^Q"
OM(7@H8 H8]1 Os   Gr*   c                   ^   a  ] tR tRt o RtRt]P                  t^(t	^ t
]! R4      tR tRtV tR# )r  i  z-dummy hasher which delays by specified amount
delay_hashz$x$c                    \         P                  ! V P                  4       \        V\        4      '       d   VP                  R 4      p\        \        P                  ! RV,           4      P                  4       4      # )r^   s   prefix)
timesleepr  rr  r   rh   r   rq  sha1rs  )rN   r*  s   &&r&   rt  DelayHash._calc_checksum  sO    

4::fg&&]]7+FW\\)f*<=GGIJJr(   rR   N)r   r   r   r   __doc__r   r   LOWER_HEX_CHARSchecksum_charschecksum_sizer  r   rv  rt  r   rx  ry  s   @r&   r  r    s7     7D''NMEU8LK Kr(   r  c                       ] tR tRtR tRtR# )dummy_2i  rR   Nr   rR   r(   r&   r   r     s    Dr(   r   c                   6   a  ] tR tRt o RtR tR tR tRtV t	R# )LazyCryptContextTesti  r   c                H    \        R 4       V P                  \         R 4       R# )r   N)unload_handler_name
addCleanup)rN   s   &r&   rK   LazyCryptContextTest.setUp  s    I&+Y7r(   c                   V P                  \        R4      4       \        RR4       \        \	        RR.4      R.R7      pV P                  \        RR4      4       V P                  VP                  4       R4       V P                  VP                  R4      P                  4       V P                  \        RR4      4       R# )ztest plain kwdsr   passlib.tests.test_contextr+   r   TNr   r+   )
r-  has_crypt_handlerr   r   iterrS   r0   r   r   rA   )rN   r   s   & r&   test_kwd_constructor)LazyCryptContextTest.test_kwd_constructor  s    *956#I/KLdI{#;<+W*9d;<'?@

;/::;))T:;r(   c                ~  a  S P                  \        R 4      4       \        R R4       RV 3R llp\        VRR7      pS P                  \        R R4      4       S P	                  VP                  4       R4       S P                  VP                  R4      P                  4       S P                  \        R R4      4       R# )	r   r  c                 X   < SP                  V 4       \        \        R R.4      R.R7      # )r   r+   r   )r   r   r  )flagrN   s   &r&   onload>LazyCryptContextTest.test_callable_constructor.<locals>.onload  s(    OOD!i%= >K=YYr(   T)r  r  r+   Nr  r	  )	r-  r
  r   r   rS   r0   r   r   rA   )rN   r  r   s   f  r&   test_callable_constructor.LazyCryptContextTest.test_callable_constructor  s    *956#I/KL	Z V$7*9d;<'?@

;/::;))T:;r(   rR   N)
r   r   r   r   r  rK   r  r  r   rx  r  s   @r&   r  r    s     *8
<< <r(   r  )Ar  
__future__r   passlib.utils.compatr   configparserr   ConfigParserr  	functoolsr   logging	getLoggerr   logrp   rL   passlibr   passlib.contextr   r   r  r	   r
   passlib.utilsr   r   r   r   r   r   r   r   passlib.utils.handlersutilsr0  r   passlib.tests.utilsr   r   r   r   r   r   passlib.registryr   r   r
  r   r  r   rq   abspathdirname__file__rz   r'   r*   rq  r  r   r  r   r  rR   r(   r&   <module>r'     s    
 & $++   g''1 	   : @ * M M # #N N  
wwrwwx01D8x D8T4 K   K"b %<8 %<r(   