
    mj                     ^    d dl Zd dlmc mZ d dlmZmZ d dlm	Z	m
Z
 d dlmZ defdZddZy)	    N)UTCdatetime)AgentOutboxRemoteAgentClientAgentRegistrationreturnc            	      $    t        ddddddd      S )Nzagent.local.alicezAlice laptopz0.1localzalice-laptoppython)	heartbeatr        M/opt/struktur/hermes-workspace/worker-watcher/tests/unit/test_remote_agent.pyregistrationr      s    0.%R`bjlz{{r   c                    t        | dz        }t        dt               |d      }	 |j                  }d}d}d}dd	d
}d}d}	d}
d}d}t	        ||	|
||t
              } ||||||      }| }|sddt        j                         v st        j                  |      rt        j                  |      ndt        j                  |      t        j                  |      t        j                  |      t        j                  |      t        j                  |      dt        j                         v st        j                  t              rt        j                  t              ndt        j                  |      t        j                  |	      t        j                  |
      t        j                  |      t        j                  |      dt        j                         v st        j                  t
              rt        j                  t
              ndt        j                  |      t        j                  |      dz  }t        t        j                  |            d x}x}x}x}x}x}x}	x}
x}x}x}x}}|j                  } |       }d}||k(  }|st        j                  d|fd||f      dt        j                         v st        j                  |      rt        j                  |      ndt        j                  |      t        j                  |      t        j                  |      dz  }dd|iz  }t        t        j                  |            d x}x}x}}|j                         d   d   }d}||k(  }|slt        j                  d|fd||f      t        j                  |      t        j                  |      dz  }dd|iz  }t        t        j                  |            d x}x}}|j!                          y # |j!                          w xY w) Nzagent.sqlitezhttp://127.0.0.1:1   )timeout_secondszworker.alphazai.pipeline.taskr   zAI pipeline<   )display_namestale_after_secondsi        r   )tzinfozassert not %(py26)s
{%(py26)s = %(py2)s
{%(py2)s = %(py0)s.emit
}(%(py4)s, %(py6)s, %(py8)s, %(py10)s, %(py24)s
{%(py24)s = %(py11)s(%(py13)s, %(py15)s, %(py17)s, %(py19)s, %(py21)s, tzinfo=%(py22)s)
})
}clientr   r   )py0py2py4py6py8py10py11py13py15py17py19py21py22py24py26)==)zC%(py4)s
{%(py4)s = %(py2)s
{%(py2)s = %(py0)s.size
}()
} == %(py7)soutbox)r   r   r   py7zassert %(py9)spy9attempts)z%(py1)s == %(py4)s)py1r   zassert %(py6)sr   )r   r   r   emitr   r   @py_builtinslocals
@pytest_ar_should_repr_global_name	_safereprAssertionError_format_explanationsize_call_reprcomparependingclose)tmp_pathr,   r   @py_assert1@py_assert3@py_assert5@py_assert7@py_assert9@py_assert12@py_assert14@py_assert16@py_assert18@py_assert20@py_assert23@py_assert25@py_assert27@py_format28@py_assert6@py_format8@py_format10@py_assert0@py_assert2@py_format5@py_format7s                           r   8test_agent_outbox_retains_event_when_watcher_unreachablerS      s   N23F3\^V]^_F;; 	H~ 	H/A 	H; 	H0=VXY	H(,	H./	H12	H46	H89	H'aB#F	H;~/A;YFH 	H H H 	H H 	HAG	H 	H/G/G  	H 	H>Gi  	H 	H>Gi  	H 	H>Gi  . 	H 	H>Gi 0B 	H 	H>Gi DO 	H 	H>Gi  Z	H 	HAG	H 	H/G/Gx	H 	H>Gix	H 	H>Gi	H 	H>Gia	H 	H>Gi	H 	H>GiB	H 	H>Gi	H 	HAG	H 	H/G/G#	H 	H>Gi#	H 	H>GiF	H 	H>GiH 	H 	H 	H4G4G	H 	H 	H 	H 	H {{!{}!!}!!!!}!!!!!!v!!!v!!!{!!!}!!!!!!!!!!~~":.3!3.!3333.!333.333!3333333s   N?O7 7P	)r	   N)builtinsr2   _pytest.assertion.rewrite	assertionrewriter4   r   r   worker_watcher.agentr   r   worker_watcher.modelsr   r   rS   r   r   r   <module>rZ      s'       " ? 3|' |
r   