
    Sj                     f   d dl Z d dlmZ d dlZ ee      j                         j                  d   Z ee      e j                  vr"e j                  j                  d  ee             d dlmZ d dlmZ  ej                  d      d        Zd	 Zd
 Zd Zej(                  j*                  d        Zy)    N)Path   )FirecrawlClient)AsyncFirecrawlClientT)autousec              #   :   K   | j                  dd       d  y w)NFIRECRAWL_API_KEYF)raising)delenv)monkeypatchs    N/root/.hermes/venv/lib/python3.12/site-packages/tests/test_api_key_handling.pyclear_firecrawl_api_key_envr      s     *E:	s   c                  x    t        j                  t              5  t        d       d d d        y # 1 sw Y   y xY wNzhttps://api.firecrawl.devapi_url)pytestraises
ValueErrorr        r   test_cloud_requires_api_keyr      s,    	z	" = ;<= = =   09c                  L    t        d      } | j                  j                  J y Nzhttp://localhost:3000r   )r   http_clientapi_keyclients    r   %test_self_host_allows_missing_api_keyr       s%    %<=F%%---r   c                  x    t        j                  t              5  t        d       d d d        y # 1 sw Y   y xY wr   )r   r   r   r   r   r   r   !test_async_cloud_requires_api_keyr"      s0    	z	" B%@AB B Br   c                    K   t        d      } 	 | j                  j                  J | j                  j	                          d {    | j                  j
                  j                  s#| j                  j	                          d {    y y 7 H7 # | j                  j
                  j                  s$| j                  j	                          d {  7   w w xY wwr   )r   r   r   async_http_clientclose_client	is_closedr   s    r   +test_async_self_host_allows_missing_api_keyr(   #   s     !*ABF3!!))111&&,,... ''//99**00222 : 	/ 3 ''//99**00222 :sL   C5B BB 
=CBCB C>CCCC)syspathlibr   r   __file__resolveparentsROOTstrpathinsertfirecrawl.v2.clientr   firecrawl.v2.client_asyncr   fixturer   r   r    r"   markasyncior(   r   r   r   <module>r7      s    
  H~''*t9CHHHHOOAs4y! / : 
 

=
.
B
 3 3r   