
    $TXg                         d Z ddlmZ ddlmZ ddlZddlmZm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   )DEFAULTS_CHANNEL_NAMENOTICES_CACHE_SUBDIR)reset_context)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      sT      
8	9^&,#L))*>?	t4 
:	9	9s   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      s7     	5	6:J(,(8% 
7	6	6s   A?	AAAc                  j    t               } | j                  ddt         g      }t        d|       || fS )Nnoticesz
--channel= )r	   
parse_argsr   r   )parserargss     r   conda_notices_args_n_parserr"   $   s<    Fi:6K5L)MNOD"d<    )__doc__pathlibr   unittestr   pytestbase.constantsr   r   base.contextr   cli.conda_argparser	   fixturer   r   r"   r   r#   r   <module>r,      sz    A    I ) 1 j!
 "
 j! " j! "r#   