+
    ir                        R t ^ RIHt ^ RIHt ^ RIt^ RIt^ RIHtH	t	 ^ RI
Ht ^ RIHt ^ RIHt ^ RIHtHtHtHt ^ R	IHt ^ R
IHt ^ RIHt ]! ]4      tRR lt]P:                  P=                  R4      ;'       g    RtRR lt R t!R t"]"! 4       w  t#t$]PJ                  ! ]#R4      t& ! R R]4      t' ! R R]4      t(R# )z@tests for passlib.apache -- (c) Assurance Technologies 2008-2011)with_statement)	getLoggerN)apacheregistry)MissingBackendError)irange)unittest)TestCaseget_fileset_fileensure_mtime_changed)u)to_bytes)to_unicode_for_identifyc                    \         P                  P                  V 4      p\         P                  P                  V 4      V,
          p\         P                  ! WV34       R# )z)backdate file's mtime by specified amountN)ospathgetatimegetmtimeutime)r   offsetatimemtimes   &&  W/var/www/html/photoedit/myenv/lib/python3.14/site-packages/passlib/tests/test_apache.pybackdate_file_mtimer      sA     GGT"EGGT"6)EHHT5>"    PASSLIB_TEST_HTPASSWD_PATHhtpasswdc                V   Ve   VP                  R4      p\        P                  ! \        .V ,           \        P                  \        P
                  V'       d   \        P                  MRR7      pVP                  V4      w  r4VP                  4       p\        T;'       g    R4      pW53# )z
helper to run htpasswd cmd
Nutf-8)stdoutstderrstdin )	encode
subprocessPopenhtpasswd_pathPIPESTDOUTcommunicatewaitr   )argsr"   procouterrrcs   &&    r   _call_htpasswdr1   +   s     W%]Od2:??#-#4#4uJOOZ^`D&HC	B
!#))
,C7Nr   c                0    \        RW.V4      w  r4V'       * # )z
wrapper for htpasswd verify
z-vi)r1   )r   userpasswordr.   r0   s   &&&  r   _call_htpasswd_verifyr5   9   s     eT0(;GC6Mr   c                      \        . 4      w  rT'       g   \        P                  R4       RT 9   pRT3#   \         d    Ru # i ; i)z(
helper to check if htpasswd is present
z htpasswd test returned with rc=0z -B T)FF)r1   OSErrorlogwarning)r.   r0   have_bcrypts      r   _detect_htpasswdr;   A   sR     $ 67C-K   s   5 AAz requires `htpasswd` cmdline toolc                     a  ] tR t^Zt o 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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R t]R 4       t ]]!PD                  ! ]#PH                  ! R4      R4      R 4       4       t%R t&V t'R!# )"HtpasswdFileTestztest HtpasswdFile classHtpasswdFilest   user2:2CHkkwa2AtqGs
user3:{SHA}3ipNV1GrBtxPmHFC21fCbVCSXIo=
user4:pass4
user1:$apr1$t4tc7jTh$GPIWVUo8sQKJlUdV8V5vu0
s4   user3:{SHA}3ipNV1GrBtxPmHFC21fCbVCSXIo=
user4:pass4
sy   user2:pass2x
user3:{SHA}3ipNV1GrBtxPmHFC21fCbVCSXIo=
user4:pass4
user1:$apr1$t4tc7jTh$GPIWVUo8sQKJlUdV8V5vu0
user5:pass5
s   useræ:2CHkkwa2AtqGs
s   user:2CHkkwa2AtqGs
s   user1:pass1
user1:pass2
s  user2:2CHkkwa2AtqGs
user3:{SHA}3ipNV1GrBtxPmHFC21fCbVCSXIo=
user4:pass4
user1:$apr1$t4tc7jTh$GPIWVUo8sQKJlUdV8V5vu0
user5:$2a$12$yktDxraxijBZ360orOyCOePFGhuis/umyPNJoL5EbsLk.s6SWdrRO
user6:$5$rounds=110000$cCRp/xUUGVgwR4aP$p0.QKFS5qLNRqw1/47lXYiAcgIjJK.WjCO8nrEKuUK.
c                r   V P                  4       p\        WP                  4       \        P                  ! V4      pV P                  VP                  4       V P                  4       V P                  VP                  V4       V P                  VP                  4       VR,           Vn        V P                  VP                  VR,           4       V P                  VP                  4       \        P                  ! VRR7      pV P                  VP                  4       R4       V P                  VP                  V4       V P                  VP                  4       V P                  R4      ;_uu_ 4        \        P                  ! VRR7      pRRR4       V P                  VP                  4       R4       V P                  VP                  V4       V P                  VP                  4       \        P                  ! V4       V P                  \        \        P                  V4       R#   + '       g   i     L; i)	test constructor autoloadxTnewr   z ``autoload=False`` is deprecatedF)autoloadN)mktempr   	sample_01r   r>   assertEqual	to_stringr   
assertTruer   assertFalseassertWarningListr   removeassertRaisesIOErrorselfr   hts   &  r   test_00_constructor_autoload-HtpasswdFileTest.test_00_constructor_autoload}   s    {{}~~&  &8$'! *$*-"   40-$'" ##$FGG$$TE:B H-$'" 			$'6#6#6= HGs   1H&&H6	c                P   V P                  4       p\        WP                  4       \        P                  P                  V4      pV P                  VP                  4       V P                  4       V P                  VP                  R 4       V P                  VP                  4       R # N)rE   r   rF   r   r>   	from_pathrG   rH   r   rJ   r   rO   s   &  r   test_00_from_path"HtpasswdFileTest.test_00_from_path   so    {{}~~&  **408$'"r   c                   \         P                  P                  V P                  4      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                  4       V P                  4       V P                  \        VP
                  R4       R# )test delete()user1user2user5user:N)r   r>   from_stringrF   rI   deleterJ   rG   rH   	sample_02rM   
ValueErrorrP   rQ   s   & r   test_01_deleteHtpasswdFileTest.test_01_delete   s      ,,T^^<		'*+		'*+7+,8 	*bii9r   c                L   V P                  4       pR p\        W4       \        P                  ! V4      pVP	                  R4       V P                  \        V4      V4       \        P                  ! VRR7      pVP	                  R4       V P                  \        V4      R4       R# )s   user1:pass1
user2:pass2
r[   T)autosaves   user2:pass2
N)rE   r   r   r>   r`   rG   r
   rP   r   samplerQ   s   &   r   test_01_delete_autosave(HtpasswdFileTest.test_01_delete_autosave   s}    {{}.  &
		'$0  5
		'$)9:r   c                   \         P                  P                  V P                  RR7      pV P	                  VP                  RR4      4       V P                  VP                  RR4      4       V P                  VP                  4       V P                  4       V P                  R4      ;_uu_ 4        \         P                  P                  V P                  RR7      pR	R	R	4       V P	                  VP                  RR4      4       V P                  VP                  RR4      4       V P                  VP                  4       V P                  4       V P                  \        VP
                  R
R4       V P                  R4      ;_uu_ 4        VP                  RR4       R	R	R	4       V P	                  VP                  RR4      4       R	#   + '       g   i     L; i  + '       g   i     LF; i)ztest set_password()	plaintextdefault_schemer\   pass2xr]   pass5z``default`` is deprecated)defaultNr^   passupdate\(\) is deprecatedtest)r   r>   r_   rF   rI   set_passwordrJ   rG   rH   	sample_03rK   rM   rb   updatecheck_passwordrc   s   & r   test_02_set_password%HtpasswdFileTest.test_02_set_password   sb     ,,NN; - 8:;':;8 ##$?@@$$000UB A:;':;8 	*boowG ##$>??IIgv& @))'6:; A@ @?s   1,G
G
G	G-	c                R   V P                  4       pR p\        W4       \        P                  ! V4      pVP	                  RR4       V P                  \        V4      V4       \        P                  ! VRRR7      pVP	                  RR4       V P                  \        V4      R4       R# )   user1:pass1
r[   pass2rm   T)ro   rg   s   user1:pass2
N)rE   r   r   r>   rv   rG   r
   rh   s   &   r   test_02_set_password_autosave.HtpasswdFileTest.test_02_set_password_autosave   s    {{}!  &
)$0  kDQ
)$)9:r   c                   R pV P                  V! R4      R4       V P                  V! R4      R4       V P                  \        VR4       V P                  V! R4      \        P                  R,          4       V P                  V! R4      \        P                  R,          4       V P                  V! R4      \        P                  R,          4       V P                  V! R4      \        P                  R,          4       R# )	z%test set_password() -- default_schemec                     \         P                  ! V R 7      pVP                  RR4       VP                  P	                  VP                  R4      4      # )rn   r[   pass1)r   r>   rv   contextidentifyget_hash)schemerQ   s   & r   checkCHtpasswdFileTest.test_02_set_password_default_scheme.<locals>.check   s>    $$F;BOOGW-::&&r{{7';<<r   sha256_crypt	des_cryptxxxportableportable_apache_22host_apache_22N)rG   rM   KeyErrorr   htpasswd_defaults)rP   r   s   & r   #test_02_set_password_default_scheme4HtpasswdFileTest.test_02_set_password_default_scheme   s    	= 	~.?{+[9 	(E51 	z*F,D,DZ,PQ34f6N6NOc6de/0&2J2JK[2\] 	tf&>&>?S&TUr   c                   \         P                  P                  V P                  4      pVP	                  RR4       VP                  R4       VP	                  RR4       V P                  \        VP                  4       4      . RO4       R# )test users()r]   rq   user3pass3Nr[   r\   r   user4r]   )	r   r>   r_   rF   rv   r`   rG   sortedusersrc   s   & r   test_03_usersHtpasswdFileTest.test_03_users   s`      ,,T^^<
)
		'
)
+-Z[r   c                L   \         P                  P                  V P                  4      pV P	                  \
        VP                  ^R4       V P                  VP                  RR4      RJ 4       \        ^^4       Fh  p\        V4      p V P                  VP                  RV,           RV,           4      4       V P                  VP                  RV,           R4      RJ 4       Kj  	  V P	                  \        VP                  RR4       V P                  R	.^,          4      ;_uu_ 4        V P                  VP                  R
R4      4       V P                  VP                  R
R4      4       RRR4       R#   \         d    TR8X  d    EK  h i ; i  + '       g   i     R# ; i)test check_password()pass9user9Nr3   rs   F5r^   verify\(\) is deprecatedr[   r   r~   )r   r>   r_   	sample_05rM   	TypeErrorry   rI   r   strr   rb   rK   verifyrJ   rP   rQ   is   &  r   test_04_check_password'HtpasswdFileTest.test_04_check_password  sS     ,,T^^<)R%6%67C))'':dBC 1AAA 1 1&(F1H EF 1 1&(G D MN	  	*b&7&7&I ##%?$@$BCCOOBIIgw78RYYw89 DC ' 8	 DCCs    
AE7*AF7FFF#	c                   V P                  4       p\        VR4       \        V^4       \        P                  ! VRR7      pV P                  VP                  4       R4       VP                  RR4       VP                  4        V P                  VP                  4       R4       \        WP                  4       VP                  4        V P                  VP                  4       V P                  4       VP                  RR	4       VP                  4        V P                  VP                  4       V P                  4       \        P                  ! 4       pV P                  \        VP                  4       V P                  \        VP                  4       \        WP                  4       \        P                  ! 4       pVP                  V4       V P                  VP                  RR4      4       R
# )test load()r#   rm   rn   r   r[   r   r}   r]   rq   N)rE   r   r   r   r>   rG   rH   rv   load_if_changedrF   loadrM   RuntimeError
sample_duprI   ry   rP   r   hahbhcs   &    r   test_05_loadHtpasswdFileTest.test_05_load  s_    {{}rD!$  kB- 	)
)9: 	~~&
8 	)
	8   ",0,(:(:; 	'  "
))'':;r   c                   V P                  4       p\        WP                  4       \        P                  ! V4      pVP                  R4       VP                  R4       VP                  4        V P                  \        V4      V P                  4       \        P                  ! RR7      pVP                  RR4       V P                  \        VP                  4       VP                  V4       V P                  \        V4      R4       R# )test save()r[   r\   rm   rn   r   r}   N)rE   r   rF   r   r>   r`   saverG   r
   ra   rv   rM   r   rP   r   rQ   r   s   &   r   test_06_saveHtpasswdFileTest.test_06_saveA  s     {{}~~&  & 			'
		'
	$8   <
),0 	$)9:r   c                   V P                  \        \        P                  RR7       \        P                  P	                  V P
                  RRR7      pV P                  VP                  4       \        R4      .4       V P                  R4      ;_uu_ 4        \        P                  P	                  V P
                  RR7      pRRR4       V P                  VP                  4       R	.4       \        P                  P	                  V P                  R
RR7      pV P                  VP                  4       \        R4      .4       R#   + '       g   i     L; i)ztest 'encoding' kwdutf-16encodingr   Tr   return_unicode   useræz``encoding=None`` is deprecatedNs   userælatin-1)rM   rb   r   r>   r_   sample_04_utf8rG   r   r   rK   sample_04_latin1rc   s   & r   test_07_encodings"HtpasswdFileTest.test_07_encodingsW  s    	*f&9&9HM   ,,T-@-@7<@ - Bq%89 ##$EFF$$001D1Dt0TB G%89   ,,T-B-B7@QU - Wq%89 GFs   ,EE	c                   \         P                  P                  V P                  4      pV P	                  VP                  R4      R4       V P	                  VP                  R4      R4       V P	                  VP                  R4      R4       V P                  R4      ;_uu_ 4        V P	                  VP                  R4      R4       RRR4       R#   + '       g   i     R# ; i)test get_hash()r   s!   {SHA}3ipNV1GrBtxPmHFC21fCbVCSXIo=r   s   pass4r]   Nfind\(\) is deprecated)r   r>   r_   rF   rG   r   rK   findrc   s   & r   test_08_get_hash!HtpasswdFileTest.test_08_get_hashk  s      ,,T^^<W-/STW-x8W-t4##$<==RWWW-x8 >===s   &"CC#	c                   \         P                  P                  V P                  4      pV P	                  VP                  4       V P                  4       \         P                  ! 4       pV P	                  VP                  4       R4       R# )ztest to_stringr   N)r   r>   r_   rF   rG   rH   rc   s   & r   test_09_to_string"HtpasswdFileTest.test_09_to_stringu  ^       ,,T^^<8   "-r   c                P    \         P                  ! R RRRR7      p\        V4       R# )fakepathTr   )rg   rC   r   N)r   r>   reprrc   s   & r   test_10_reprHtpasswdFileTest.test_10_repr  s      dyYRr   c                    V P                  \        \        P                  P                  R 4       V P                  \        \        P                  P                  R4       R# )s   realm:user1:pass1
s   pass1
N)rM   rb   r   r>   r_   rP   s   &r   test_11_malformed"HtpasswdFileTest.test_11_malformed  sD    *f&9&9&E&E"	$*f&9&9&E&E	r   c                h    V P                  \        \        P                  P                  R RR7       R# )r   N)r   )rM   r   r   r>   r_   r   s   &r   test_12_from_string$HtpasswdFileTest.test_12_from_string  s*    )V%8%8%D%DD 	 	*r   c                r   \        R4      p\        P                  P                  V4      pV P	                  \        VP                  4       4      . R	O4       VP                  RR4       V P	                  \        VP                  4       4      . R	O4       VP                  RR4       V P	                  \        VP                  4       4      . R
O4       VP                  R4       V P	                  \        VP                  4       4      . RO4       \        R4      pV P	                  VP                  4       V4       R# )zwhitespace & comment handlingz`
user2:pass2
user4:pass4
user7:pass7
 	 
user1:pass1
 # legacy users
#user6:pass6
user5:pass5

r   user7althash4user6althash6zd
user2:pass2
user4:althash4
 	 
user1:pass1
 # legacy users
#user6:pass6
user5:pass5
user6:althash6
N)r[   r\   r   r]   r   )r[   r\   r   r]   r   r   )r[   r\   r   r]   r   )
r   r   r>   r_   rG   r   r   set_hashr`   rH   )rP   sourcerQ   targets   &   r   test_13_whitespace#HtpasswdFileTest.test_13_whitespace  s    
 

   ,,V4
+-Z[ 	GZ(
+-Z[ 	GZ(
+-cd 			'
+-Z[ 

 	0r   c                "  a V P                  4       p\        P                  ! VRR7      oV3R lpSP                  RV! RR4      4       \        P                  R,          pSP                  RV! RV4      4       \        P                  R	,          pSP                  R
V! RV4      4       SP                  RR4       SP                  4        V P                  \        VRR4      4       V P                  \        VRR4      4       V P                  \        VR
R4      4       V P                  \        VRR4      4       V P                  \        VRR4      4       V P                  \        VRR4      4       V P                  \        VR
R4      4       R# )z+
verify "htpasswd" command can read output
Tr   rC   c                 X   < SP                   P                  V4      P                  V 4      # rU   r   handlerhashpwdr   rQ   s   &&r   hash_scheme>HtpasswdFileTest.test_htpasswd_cmd_verify.<locals>.hash_scheme  #    ::%%f-22377r   r[   r4   apr_md5_cryptr   r\   hostr   r   z$xxx$foo$bar$bazwrongN)	rE   r   r>   r   r   r   rJ   r5   rI   )rP   r   r   host_no_bcrypt	host_bestrQ   s   &    @r   test_htpasswd_cmd_verify)HtpasswdFileTest.test_htpasswd_cmd_verify  sK   
 {{}  d5	8 	G[ODE  112BC
G[^DE ,,V4	
G[Y?@ 	G/0 		.tWgFG.tWgFG.tWgFG.tWgFG-dGZHI-dGZHI-dGZHIr   bcryptzbcrypt support requiredc                z  a V P                  4       p\        P                  ! VRR7      oV3R lpSP                  RV! RR4      4       SP	                  4        V P                  \        VRR4      4       \        '       d   V P                  \        VRR4      4       R# V P                  \        VRR4      4       R# )	z
verify "htpasswd" command can read bcrypt format

this tests for regression of issue 95, where we output "$2b$" instead of "$2y$";
fixed in v1.7.2.
Tr   c                 X   < SP                   P                  V4      P                  V 4      # rU   r   r   s   &&r   r   EHtpasswdFileTest.test_htpasswd_cmd_verify_bcrypt.<locals>.hash_scheme  r   r   r[   r4   r   r   N)	rE   r   r>   r   r   rJ   r5   HAVE_HTPASSWD_BCRYPTrI   )rP   r   r   rQ   s   &  @r   test_htpasswd_cmd_verify_bcrypt0HtpasswdFileTest.test_htpasswd_cmd_verify_bcrypt  s     {{}  d5	8
G[X>?
	.tWgFGOO1$LM 24*MNr    N)(__name__
__module____qualname____firstlineno____doc__descriptionPrefixrF   ra   rw   r   r   r   r   rR   rW   rd   rj   rz   r   r   r   r   r   r   r   r   r   r   r   r   r   requires_htpasswd_cmdr   r   
skipUnlessr   has_backendr  __static_attributes____classdictcell____classdict__s   @r   r=   r=   Z   s     !&BI JI"I 5N2.JFI>D#	:;<.;V.\:4!<J;,:(9	.*
-1^ "J "JH --h79RSO T Or   r=   c                      a  ] tR tRt o 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R tR tR tR tR tR tR tRtV tR# )HtdigestFileTesti   ztest HtdigestFile classHtdigestFiles   user2:realm:549d2a5f4659ab39a80dac99e159ab19
user3:realm:a500bb8c02f6a9170ae46af10c898744
user4:realm:ab7b5d5f28ccc7666315f508c7358519
user1:realm:2a6cf53e7d8f8cf39d946dc880b14128
sZ   user3:realm:a500bb8c02f6a9170ae46af10c898744
user4:realm:ab7b5d5f28ccc7666315f508c7358519
s   user2:realm:5ba6d8328943c23c64b50f8b29566059
user3:realm:a500bb8c02f6a9170ae46af10c898744
user4:realm:ab7b5d5f28ccc7666315f508c7358519
user1:realm:2a6cf53e7d8f8cf39d946dc880b14128
user5:realm:03c55fdc6bf71552356ad401bdb9af19
s0   useræ:realmæ:549d2a5f4659ab39a80dac99e159ab19
s.   user:realm:549d2a5f4659ab39a80dac99e159ab19
c                   V P                  4       p\        WP                  4       \        P                  ! V4      pV P                  VP                  4       V P                  4       \        P                  ! VRR7      pV P                  VP                  4       R4       \        P                  ! V4       V P                  \        \        P                  V4       R# )r@   TrB   r   N)rE   r   rF   r   r  rG   rH   r   rL   rM   rN   rO   s   &  r   rR   -HtdigestFileTest.test_00_constructor_autoload  s     {{}~~&  &8   40- 			$'6#6#6=r   c                <   \         P                  P                  V P                  4      pV P	                  VP                  RR4      4       V P	                  VP                  RR4      4       V P                  VP                  RR4      4       V P                  VP                  RR4      4       V P                  VP                  4       V P                  4       V P                  \        VP
                  RR4       V P                  \        VP
                  RR	4       R
# )rZ   r[   realmr\   r]   r   realm5r^   r3   realm:N)r   r  r_   rF   rI   r`   rJ   rG   rH   ra   rM   rb   rc   s   & r   rd   HtdigestFileTest.test_01_delete+  s      ,,T^^<		'734		'7347G457H568 	*bii'B 	*biiBr   c                &   V P                  4       p\        WP                  4       \        P                  ! V4      pV P                  VP                  R R4      4       V P                  VP                  RR4      4       V P                  VP                  RR4      4       V P                  \        V4      V P                  4       RVn
        V P                  VP                  RR4      4       V P                  \        V4      V P                  4       R# )r[   r  r   r  r]   Tr\   N)rE   r   rF   r   r  rI   r`   rJ   rG   r
   rg   ra   rO   s   &  r   rj   (HtdigestFileTest.test_01_delete_autosave:  s    {{}~~&  &		'7347H567G45$8		'734$8r   c                   \         P                  P                  V P                  4      pV P	                  VP                  RRR4      4       V P                  VP                  RRR4      4       V P                  VP                  4       V P                  4       V P                  \        VP
                  RR4       RVn        VP                  RR4       VP                  RRR4       V P                  \        VP
                  RRR	4       V P                  \        VP
                  RRR	4       V P                  \        VP
                  R
RR	4       V P                  \        VP
                  R
RR	4       V P                  R4      ;_uu_ 4        VP!                  RRR4       RRR4       V P	                  VP                  RR4      4       R#   + '       g   i     L3; i)ztest update()r\   r  rp   r]   rq   r   realm2r^   rs   r3   r  rt   ru   N   uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu   rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr)r   r  r_   rF   rI   rv   rJ   rG   rH   rw   rM   r   default_realmry   rb   rK   rx   rc   s   & r   rz   %HtdigestFileTest.test_02_set_passwordH  se     ,,T^^<(CD'7CD8 	)R__gwG#
)
'8W5 	*boowP*boowP 	*boovxP*boovwO ##$>??IIgx0 @))'6:; @?s   G

G	c                b   \         P                  P                  V P                  4      pVP	                  RRR4       VP                  RR4       VP	                  RRR4       V P                  \        VP                  R4      4      . RO4       V P                  \        VP                  ^4       R# )r   r]   r  rq   r   r   Nr   )r   r  r_   rF   rv   r`   rG   r   r   rM   r   rc   s   & r   r   HtdigestFileTest.test_03_usersd  s      ,,T^^<
'2
		'7#
'2 124ab)RXXq1r   c           	     :   \         P                  P                  V P                  4      pV P	                  \
        VP                  ^RR4       V P	                  \
        VP                  R^R4       V P                  VP                  RRR4      R4       \        ^^4       Fh  p\        V4      pV P                  VP                  RV,           RRV,           4      4       V P                  VP                  RV,           RR4      R4       Kj  	  V P	                  \
        VP                  RR4       RVn        V P                  VP                  RR	4      4       V P                  VP                  RR4      R4       V P                  R
.^,          4      ;_uu_ 4        V P                  VP                  RRR	4      4       V P                  VP                  RRR4      4       RRR4       V P	                  \        VP                  RRR4       R#   + '       g   i     L5; i)r   r  rq   r3   r]   Nrs   Fr[   r   r   r~   r^   )r   r  r_   rF   rM   r   ry   assertIsr   r   rI   r!  rK   r   rJ   rb   r   s   &  r   r   'HtdigestFileTest.test_04_check_passwordn  s     ,,T^^<)R%6%67GL)R%6%67Kb''A4H!AAAOOB--fQhJKMM"++F1HgwGO  	)R%6%6I"))'7;<b''94@ ##%?$@$BCCOOBIIgw@ARYYwAB D
 	*b&7&7'6R DCs   AH

H	c                   V P                  4       p\        VR4       \        V^4       \        P                  ! V4      pV P                  VP                  4       R4       VP                  RRR4       VP                  4        V P                  VP                  4       R4       \        WP                  4       VP                  4        V P                  VP                  4       V P                  4       VP                  RRR4       VP                  4        V P                  VP                  4       V P                  4       \        P                  ! 4       pV P                  \        VP                  4       V P                  \        VP                  4       \        P                  ! 4       pVP                  V4       V P                  VP                  4       V P                  4       \        V4       \        VR4       V P                  R	4      ;_uu_ 4        VP                  R
R7       RRR4       V P                  VP                  4       R4       R#   + '       g   i     L2; i)r   r#   r   r[   r  r   s-   user1:realm:2a6cf53e7d8f8cf39d946dc880b14128
r]   rq   z!load\(force=False\) is deprecatedF)forceN)rE   r   r   r   r  rG   rH   rv   r   rF   r   rM   r   r   rK   r   s   &    r   r   HtdigestFileTest.test_05_load  s    {{}rD!$  &- 	'2
)Z[ 	~~&
8 	'2
	8   ",0,(:(:;   "
8 	T"r##$HIIGG%G  J- JIs   II 	c                2   V P                  4       p\        WP                  4       \        P                  ! V4      pVP                  RR4       VP                  RR4       VP                  4        V P                  \        V4      V P                  4       \        P                  ! 4       pVP                  RRR4       V P                  \        VP                  4       VP                  V4       V P                  \        V4      VP                  4       4       R# )r   r[   r  r\   r   N)rE   r   rF   r   r  r`   r   rG   r
   ra   rv   rM   r   rH   r   s   &   r   r   HtdigestFileTest.test_06_save  s     {{}~~&  & 			'7#
		'7#
	$8   "
'2,0 	$8r   c                   \         P                  P                  V P                  4      pV P	                  VP                  R4      ^ 4       V P	                  VP                  4       R.4       V P	                  VP                  R4      ^4       V P	                  VP                  4       . 4       V P	                  VP                  4       R4       R# )ztest realms() & delete_realm()rA   r  r   N)r   r  r_   rF   rG   delete_realmrealmsrH   rc   s   & r   test_07_realmsHtdigestFileTest.test_07_realms  s      ,,T^^<-q1wi0115b)-r   c                   \         P                  P                  V P                  4      pV P	                  VP                  RR4      R4       V P	                  VP                  RR4      R4       V P	                  VP                  RR4      R4       V P                  R4      ;_uu_ 4        V P	                  VP                  RR4      R4       RRR4       R#   + '       g   i     R# ; i)	r   r   r   a500bb8c02f6a9170ae46af10c898744r    ab7b5d5f28ccc7666315f508c7358519r]   Nr   )r   r  r_   rF   rG   r   rK   r   rc   s   & r   r   !HtdigestFileTest.test_08_get_hash  s      ,,T^^<Wg68Z[Wg68Z[Wg6=##$<==RWWWg68Z[ >===s   )#CC'	c                z   V P                  \        \        P                  RR7       \        P                  P	                  V P
                  RRR7      pV P                  VP                  4       \        R4      .4       V P                  VP                  \        R4      4      \        R4      .4       \        P                  P	                  V P                  RRR7      pV P                  VP                  4       \        R4      .4       V P                  VP                  \        R4      4      \        R4      .4       R	# )
ztest encoding parameterr   r   r   Tr   u   realmær   r   N)rM   rb   r   r  r_   r   rG   r/  r   r   r   rc   s   & r   test_09_encodings"HtdigestFileTest.test_09_encodings  s     	*f&9&9HM   ,,T-@-@7cg,h-(8&:;!M"23q5HI   ,,T-B-BYgk,l-(8&:;!M"23q5HIr   c                   \         P                  P                  V P                  4      pV P	                  VP                  4       V P                  4       \         P                  ! 4       pV P	                  VP                  4       R4       R# )ztest to_string()r   N)r   r  r_   rF   rG   rH   rc   s   & r   test_10_to_string"HtdigestFileTest.test_10_to_string  r   r   c                    V P                  \        \        P                  P                  R 4       V P                  \        \        P                  P                  R4       R# )s   realm:user1:pass1:other
r}   N)rM   rb   r   r  r_   r   s   &r   r   "HtdigestFileTest.test_11_malformed  sD    *f&9&9&E&E(	**f&9&9&E&E	r   r  N)r  r  r  r  r  r	  rF   ra   rw   r   r   rR   rd   rj   rz   r   r   r   r   r0  r   r7  r:  r   r  r  r  s   @r   r  r     s     !&CICICI VNO>$C9<82S2'.R9,	.\J	. r   r  )
   rU   ))r  
__future__r   loggingr   r   r%   passlibr   r   passlib.excr   passlib.utils.compatr   passlib.tests.backportsr   passlib.tests.utilsr	   r
   r   r   r   passlib.utilsr   passlib.utils.handlersr   r  r8   r   environgetr'   r1   r5   r;   HAVE_HTPASSWDr   r  r
  r=   r  r  r   r   <module>rK     s    F &  	  % + ' , R R " " :# 

;<JJ
" '7&8 ## ++M;]^ ]Ox ]OLyx yr   