+
    5mjH  c                     ^ RI Ht ^ RIt^ RIHu Ht ^ RIt^ RI	t	^ RI
Ht ^ RIt]	P                  P                  ^ ]! ]! ]4      P#                  4       P$                  ^,          4      4       ^ RIHtHt ^ RIHt ^ RIHt ^ RIHt R R	 ltR
 R lt ! R R4      t]P>                  R R l4       t R R lt!R R lt"R R lt#R# )    )annotationsN)PathAccount
AccountRef)ClaudeHealthClientUsageReading)HealthStatusc                    V ^8  d   QhRRRR/# )   homer   returnr    )formats   "p/home/user/overdeck-private-tests/workstation-ai-broad/modules/systray/tests/test_claude_health_rotation_auto.py__annotate__r      s     d d4 dG d    c                6    \        \        R R4      RV RRR4      # )claudezyncZynczzync@example.commaxacct_1r   r   s   &r   _accountr      s!    :h/?QSXZbccr   c                    V ^8  d   QhRRRR/# )r   r   r   r   Noner   )r   s   "r   r   r      s      T d r   c                    V P                  R R R7       V R,          P                  \        P                  ! RRRRRRR	//4      R
R7       R# )T)parentsexist_okz.credentials.jsonclaudeAiOauthaccessTokenaccessrefreshTokenrefresh	expiresAtl    (6zutf-8)encodingN)mkdir
write_textjsondumpsr   s   &r   _write_credentialsr,      sY    JJtdJ+	++

!8"I!2"	
  , r   c                  P    ] tR t^%t$ . tR]R&   . tR]R&   RR R lltR R	 ltR
t	R# )_RecordingSessionz
list[bool]rotation_flagszlist[Path | None]backup_pathsNc          
     ,    V ^8  d   QhRRRRRRRRR	R
/# )r   credentials_pathr   timeout_secsfloatallow_rotationboolrotation_backup_pathzPath | Noner   r   r   )r   s   "r   r   _RecordingSession.__annotate__)   s<     = == = 	=
 *= 
=r   c                	    \        V 4      P                  P                  V4       \        V 4      P                  P                  V4       R # N)typer/   appendr0   )selfr2   r3   r5   r7   s   &&&&&r   __init___RecordingSession.__init__)   s5     	T
!!((8T
&&';<r   c                   V ^8  d   QhRR/# )r   r   r	   r   )r   s   "r   r   r8   3   s     ^ ^< ^r   c                	$    \        R R^//RR7      # )	five_hourutilizationr#   )payloadaccess_tokenr   )r=   s   &r   get_usage_reading#_RecordingSession.get_usage_reading3   s    [=!2D$ET\]]r   r   )g      @FN)
__name__
__module____qualname____firstlineno__r/   __annotations__r0   r>   rF   __static_attributes__r   r   r   r.   r.   %   s(    !#NJ#&(L#(=^ ^r   r.   c                    V ^8  d   QhRRRR/# )r   monkeypatchpytest.MonkeyPatchr   type[_RecordingSession]r   )r   s   "r   r   r   8   s      - 2I r   c                    . \         n        . \         n        V P                  \        R \        R 4      4       V P                  R\         4       V P                  RR 4       \         # )_auth_statusc                "    \         P                  # r:   )r
   OK)_home_creds_timeouts   &&&r   <lambda>recording.<locals>.<lambda>>   s    \__r   z'claude_health_client.ClaudeOAuthSession-claude_health_client.account_has_live_sessionc                    R # )Fr   rV   s   &r   rY   rZ   B   s    ur   )r.   r/   r0   setattrr   staticmethod)rO   s   &r   	recordingr`   7   sa    ')$%'"DE
 ACTU79L r   c               $    V ^8  d   QhRRRRRR/# r   r`   rQ   tmp_pathr   r   r   r   )r   s   "r   r   r   G   s$     . .&.26.	.r   c           	     <   VR ,          p\        V4       \        4       P                  \        V4      4       V P                  pR.qCV8H  qU'       g   \
        P                  ! R	V3R
W434      RR\        P                  ! 4       9   g   \
        P                  ! V 4      '       d   \
        P                  ! V 4      MRR\
        P                  ! V4      R\
        P                  ! V4      /,          pRRV/,          p\        \
        P                  ! V4      4      hR;p;rTR# )CLAUDE_HOMETpy0r`   py2py5assert %(py7)spy7N==z6%(py2)s
{%(py2)s = %(py0)s.rotation_flags
} == %(py5)s)r,   r   fetchr   r/   
@pytest_ar_call_reprcompare@py_builtinslocals_should_repr_global_name	_safereprAssertionError_format_explanation)r`   rc   r   @py_assert1@py_assert4@py_assert3@py_format6@py_format8s   &&      r   8test_rotation_is_on_by_default_for_the_accounts_own_filer|   G   s     m#Dtx~.##-v-v-----#------9----9---#---v--------r   c               (    V ^8  d   QhRRRRRRRR/# )	r   r`   rQ   rO   rP   rc   r   r   r   r   )r   s   "r   r   r   R   s0     / /&/#/ / 
	/r   c           	     b   VR ,          p\        V4       VP                  RR 4       \        4       P                  \	        V4      4       V P
                  pR.qTV8H  qf'       g   \        P                  ! RV3RWE34      RR\        P                  ! 4       9   g   \        P                  ! V 4      '       d   \        P                  ! V 4      MRR\        P                  ! V4      R\        P                  ! V4      /,          pRR	V/,          p\        \        P                  ! V4      4      hR
;p;reR
# )re   r[   c                    R # )Tr   r]   s   &r   rY   7test_a_live_session_disables_rotation.<locals>.<lambda>Z   s    tr   Frf   r`   rg   rh   ri   rj   Nrk   rm   )r,   r^   r   rn   r   r/   ro   rp   rq   rr   rs   rt   ru   rv   )	r`   rO   rc   r   rw   rx   ry   rz   r{   s	   &&&      r   %test_a_live_session_disables_rotationr   R   s    
 m#Dt79K x~.##.w.w.....#......9....9...#...w........r   c               $    V ^8  d   QhRRRRRR/# rb   r   )r   s   "r   r   r   b   s$     0 0&0260	0r   c                   VR ,          p\        V4       \        4       P                  \        V4      4       V P                  w  pRqCVJqU'       g   \
        P                  ! RV3RW434      RR\        P                  ! 4       9   g   \
        P                  ! V4      '       d   \
        P                  ! V4      MRR\
        P                  ! V4      /,          pRRV/,          p\        \
        P                  ! V4      4      hR;rTVP                  pRqV8H  q'       g   \
        P                  ! RV	3RWX34      RR\        P                  ! 4       9   g   \
        P                  ! V4      '       d   \
        P                  ! V4      MRR\
        P                  ! V4      R\
        P                  ! V4      /,          pR	R
V/,          p
\        \
        P                  ! V
4      4      hR;p;rVP                  qUP                  p	RqV8H  q'       g   \
        P                  ! RV3RW34      RR\        P                  ! 4       9   g   \
        P                  ! V4      '       d   \
        P                  ! V4      MRR\
        P                  ! V4      R\
        P                  ! V	4      R
\
        P                  ! V4      /,          p
RRV
/,          p\        \
        P                  ! V4      4      hR;p;p	;rR# )re   Nrf   backuppy3zassert %(py5)srh   zzync.credentials.json.autorg   ri   rj   ztoken-rescuepy4zassert %(py9)spy9)is not)z%(py0)s is not %(py3)srk   )z,%(py2)s
{%(py2)s = %(py0)s.name
} == %(py5)s)zH%(py4)s
{%(py4)s = %(py2)s
{%(py2)s = %(py0)s.parent
}.name
} == %(py7)s)r,   r   rn   r   r0   ro   rp   rq   rr   rs   rt   ru   rv   nameparent)r`   rc   r   r   @py_assert2rw   @py_format4rz   rx   ry   r{   @py_assert6@py_assert5@py_format10s   &&            r   2test_backup_path_names_the_account_in_token_rescuer   b   s    m#Dtx~.&&IV666;;666666666;666666666666666;666666666666==//////////////6////6///=//////////////r   )$
__future__r   builtinsrq   _pytest.assertion.rewrite	assertionrewritero   r*   syspathlibr   pytestpathinsertstr__file__resolver   account_registryr   r   claude_health_clientr   claude_oauthr	   health_clientr
   r   r,   r.   fixturer`   r|   r   r   r   r   r   <module>r      s    "    
   3tH~--/77:; < 0 3 % &d ^ ^$  ./ 0r   