+
    :1j                         R t ^ RIt^ RIt^ RIHt ^ RIHt ^ RIt^ RIH	t	 ^RI
Ht ]! R4      t]P                  ! 4       R 4       tR# )z;Collection of pytest fixtures used in conda.gateways tests.N)Path)which)ProcessStarter)jsonminioc              #  .  aa"    ! V3R lR4      p\        R4       V! 4       o ! VV3R lR\        4      pV P                  SP                  V4      w  rE\        RV RV 24       Sx  V P	                  SP                  4      P                  4        R# 5i)	a   
Mock a local S3 server using `minio`

This requires:
- pytest-xprocess: runs the background process
- minio: the executable must be in PATH

Note, the given S3 server will be EMPTY! The test function needs
to populate it. You can use
`conda.testing.helpers.populate_s3_server` for that.
c                   \   <a  ] tR t^"t o RtRtV3R lt]R 4       t]R 4       t	R t
RtV tR# )	minio_s3_server.<locals>.Miniozminio-s3-serveri(#  c                \   < \        S4      V P                  ,          P                  4        R # )N)r   namemkdir)selftmp_paths   &?lib/python3.14/site-packages/conda/testing/gateways/fixtures.py__init__'minio_s3_server.<locals>.Minio.__init__)   s    (^dii'..0    c                8    V P                    R V P                   2# )/)endpointr   r   s   &r   
server_url)minio_s3_server.<locals>.Minio.server_url,   s    mm_Adii[11r   c                     R V P                    2# )zhttp://localhost:)portr   s   &r   r   'minio_s3_server.<locals>.Minio.endpoint0   s    &tyyk22r   c                   ^ RI Hp ^ RIHp V! 4       pVP	                  RVRRV! RR7      RR7      p\
        P                  ! R	R
RRRRRRRRR.RRV R2/./4      pVP                  W(R7       \        P                  ! V4       Fd  w  rpV FX  p\        W4      pVP                  V4      pVP                  \        V4      V\        V4      P                  RR4      RR/R7       KZ  	  Kf  	  R# )z0Prepare the s3 connection for our minio instance)Session)Configs3
minioadmins3v4)signature_versionz	us-east-1)endpoint_urlaws_access_key_idaws_secret_access_keyconfigregion_nameVersionz
2012-10-17	StatementSidAddPermEffectAllow	Principal*Actionzs3:GetObjectResourcezarn:aws:s3:::z/*)BucketPolicy\r   ACLzpublic-read)	ExtraArgsN)boto3.sessionr   botocore.clientr   clientr   dumpsput_bucket_policyoswalkr   relative_toupload_filestrreplace)r   r   bucket_namechannel_dirr   r   sessionr9   bucket_policycurrent_filesfpathkeys   &&&&           r   populate_bucket.minio_s3_server.<locals>.Minio.populate_bucket4   s   -. iG^^%".&27' $ F !JJ|!9$g'$~&6&-}B(G"M $$K$N &(WW[%9!EA+D**;7C&&D	#C((s3#(-"8	 '   &:r    N)__name__
__module____qualname____firstlineno__r   r   r   propertyr   r   rL   __static_attributes____classdictcell__)__classdict__r   s   @r   Minior	   "   sH      !	1 
	2 
	2 
	3 
	3+	 +	r   rW   zStarting mock_s3_serverc                   z   <a  ] tR t^dt o RtRt^
t]RR ZP                   2 Z.t	 ZP                  3R lt
RtV tR# ) minio_s3_server.<locals>.StarterzMinIO Object Storage ServerTserverz--address=:c                   \         P                   ! 4       pR pRp VP                  W134       VP	                  4        V'       * #   \         d!   p\        RY1T3,          4       Rp Rp?L=Rp?ii ; i  TP	                  4        i ; i)	localhostFz-something's wrong with %s:%d. Exception is %sTN)socketconnect	Exceptionprintclose)r   r   saddresserrores   &&    r   startup_check.minio_s3_server.<locals>.Starter.startup_checko   sx    A!GE		7/* 	9  CwVWFXX 	 	s)   A A/A*%A2 *A//A2 2BrN   N)rO   rP   rQ   rR   patternterminate_on_interrupttimeout	MINIO_EXEr   argsrf   rT   rU   )rV   r   r   s   @r   StarterrY   d   sF     /!%%**&	
 &+ZZ 	 	r   rm   zServer (PID: z) log file can be found here: N)r`   r   ensurer   getinfo	terminate)xprocessr   rW   rm   pidlogfiler   s   &f    @r   minio_s3_serverrt      s     = =~ 

#$GE . 8 ??5::w7LC	M#<WI
FG
KUZZ **,s   BB)__doc__r<   r]   pathlibr   shutilr   pytestrq   r   common.serializer   rk   fixturert   rN   r   r   <module>r{      sF    B 	     # $'N	
 n- n-r   