
    wBf                         d Z ddlmZ ddlmZ ddlZddlmZ ddlm	Z	  ej                  d	      d
        Z ej                  d	      d        Z ej                  d	      d        Zy)z:Collection of pytest fixtures used in conda.notices tests.    )Path)mockN   )NOTICES_CACHE_SUBDIR)generate_parserfunction)scopec              #      K   t        j                  d      5 }| |_        t        |       j	                  t
              }|j                  dd       | ddd       y# 1 sw Y   yxY ww)zi
    Fixture that creates the notices cache dir while also mocking
    out a call to user_cache_dir.
    z"conda.notices.cache.user_cache_dirT)parentsexist_okN)r   patchreturn_valuer   joinpathr   mkdir)tmpdiruser_cache_dir	cache_dirs      >lib/python3.12/site-packages/conda/testing/notices/fixtures.pynotices_cache_dirr      s]      
8	9 ^&,#L))*>?	t4  s   A*=A	A*A'#A*c               #      K   t        j                  d      5 } t        j                         | _        |  d d d        y # 1 sw Y   y xY ww)Nzconda.notices.fetch.get_session)r   r   	MagicMockr   )mock_get_sessions    r   notices_mock_fetch_get_sessionr      s@     	5	6 :J(,(8%  s   A?	AAAc                  B    t               } | j                  dg      }|| fS )Nnotices)r   
parse_args)parserargss     r   conda_notices_args_n_parserr   #   s&    Fi[)D<    )__doc__pathlibr   unittestr   pytestbase.constantsr   cli.conda_argparser   fixturer   r   r    r    r   <module>r)      sw    A    2 1 j!
 "
 j! " j! "r    