
    si                         S r SSKJr  SSKJr  SSKrSSKJrJr  SSK	J
r
  SSKJr  \R                  " S	S
9S 5       r\R                  " S	S
9S 5       r\R                  " S	S
9S 5       rg)z:Collection of pytest fixtures used in conda.notices tests.    )Path)mockN   )DEFAULTS_CHANNEL_NAMENOTICES_CACHE_SUBDIR)reset_context)generate_parserfunction)scopec              #      #    [         R                  " S5       nXl        [        U 5      R	                  [
        5      nUR                  SSS9  Uv   SSS5        g! , (       d  f       g= f7f)z]
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.13/site-packages/conda/testing/notices/fixtures.pynotices_cache_dirr      sQ      
8	9^&,#L))*>?	t4 
:	9	9s   A,9A	A,
A)%A,c               #      #    [         R                  " S5       n [         R                  " 5       U l        U v   S S S 5        g ! , (       d  f       g = f7f)Nzconda.notices.fetch.get_session)r   r   	MagicMockr   )mock_get_sessions    r   notices_mock_fetch_get_sessionr      s6     	5	6:J(,(8% 
7	6	6s   AA	A
AAc                  h    [        5       n U R                  SS[         3/5      n[        SU5        X4$ )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,      st    A    I ) 1 j!
 "
 j! " j! "r#   