
    _j
                     J   S SK r S SKrS SKrS SKrS SKJr  \" 5         S\S\4S jr\R                  " SS9S 5       r	Sr
\ R                  " S	5      =(       d4    \ R                  " S
5      =(       d    \ R                  " S5      =(       d    Sr\ R                  " S5      r\(       aS  \ R                  " S5      =(       d    Sr\" S\05      r
\
R                  SS5      \ R                   S'   \\ R                   S'   \R                  " SS9S 5       r\R                  " SS9S 5       rg)    N)load_dotenvidentity_requestreturnc                 |   [         R                  " S5      nU(       d  [        S5      e[        [         R                  " S5      =(       d    S5      n[         R                  " S5      =(       d    SUU R	                  SS5      S	.U En[
        R                  " US
-   US9nUR                  5         UR                  5       $ )N	IDMUX_URLz?IDMUX_URL is not set. E2E tests must use idmux for credentials.GITHUB_RUN_NUMBERr   GITHUB_REF_NAMElocalconcurrencyd   )refName	runNumberr   /)json)	osgetenvEnvironmentErrorintgetrequestspostraise_for_statusr   )r   	idmux_url
run_numberpayloadresps        X/home/rurouni/.local/lib/python3.13/site-packages/firecrawl/__tests__/e2e/v2/conftest.py_idmuxr   	   s    		+&I`aaRYY238q9J99./:7'++M3? 	G ==Sw7D99;    session)scopec                      [         R                  " S5      =(       d<    [         R                  " S5      =(       d    [         R                  " S5      =(       d    S$ )NTEST_URLFIRECRAWL_API_URLAPI_URLhttps://api.firecrawl.dev)r   r    r   r   api_urlr(      sB     			* 	'99()	'99Y	' '	r   r#   r$   r%   r&   r   PYTEST_RUN_NAMEzpy-e2enameapiKey API_KEYc                      [         =(       d\    [        R                  " S5      =(       d    S[        R                  " S5      =(       d    [        R                  " S5      =(       d    SS.$ )Nr-   r,   TEST_TEAM_IDTEAM_ID)r+   teamId)	_IDENTITYr   r   r'   r   r   api_identityr3   3   sW      B299Y#7#=2SaIb  JAfhfofopyfz  JA  A  B  Br   T)autousec           
      d   [        U SS 5      nUb4  [        US5      (       d#   SSKJn  U" UR	                  SS5      US9Ul        [        U SS 5      nUb<  [        US	5      (       d*   SSKJn  [        US	U" UR	                  SS5      US95        g g g ! [         a     NYf = f! [         a     g f = f)
Ninstanceclientr   )	Firecrawlr+   r,   )api_keyr(   module	firecrawl)getattrhasattrr;   r8   r   r7   	Exceptionsetattr)requestr3   r(   instr8   mods         r   _inject_clientrC   7   s     7J-Dh 7 7	+#L,<,<Xr,JT[\DK '8T
*C
wsK88	+Ci8H8HSU8V`g&hi  9	  		  		s#   "B '(B" 
BB"
B/.B/)r   r   pytestr   dotenvr   dictr   fixturer(   r2   r   _API_URL
_IDMUX_URLrun_namer   environr3   rC   r'   r   r   <module>rL      s%   	     T d  i  ! 	IIj #	yy$%#	yy# #	 	 YY{#
yy*+7xH)*I%MM(B7BJJy$BJJyi B !B  r   