+
    @,Qjc  c                   p    R t ^ RIt^ RIHu Ht ^ RIt ! R R4      tR t	R t
R tR tR tR	 tR
 tR tR# )ud   phone_store: typed-memory CRUD + SMS matching. Memory HTTP is a fake
in-memory store — no network.Nc                   4   a  ] tR t^t o RtR tRR ltRtV tR# )FakeMemzGMinimal stand-in for the memory service: /remember, /memories, /forget.c                "    . V n         ^ V n        R# )    N)rows_n)selfs   &L/Users/ahmed/devFolder/Ultron/claude-voice/gateway/tests/test_phone_store.py__init__FakeMem.__init__	   s    	    Nc                  "   VR 8X  du   V ;P                   ^,          un         RV P                    2pV P                  P                  RVRVR,          RVP                  R4      RVP                  R4      /4       RV/# VR8X  do   VP                  R4      pVP                  R4      p\	        V P                  4       U	u. uF)  p	V	R,          V8X  g   K  Ve   V	R,          V8X  g   K'  V	NK+  	  p
p	RV
/# VR	8X  d>   VR,          pV P                   U	u. uF  qR,          V8w  g   K  V	NK  	  up	V n        R
R/# / # u up	i u up	i 5i)z	/remembermidfacttextkindgroupz	/memoriesmemoriesz/forgetokT)r   r   appendgetreversed)r   methodpathparamsbodytimeoutmidgrpr   routbids   &&&&&&      r   requestFakeMem.request   s=    ;GGqLGdggY-CIIdCf$dhhv&6%txx'8: ; #;;**W%C::f%D&tyy1 <1jC' &	T(9 11C < $$9t*C$(II@Iq4CI@DI$<	< As0   B<E>D9D9'D9-$ED>%D>+E)r   r   )NNg      4@)	__name__
__module____qualname____firstlineno____doc__r	   r"   __static_attributes____classdictcell__)__classdict__s   @r   r   r      s     Q r   r   c                 \    \        4       pV P                  \        R VP                  4       V# )_mem_request)r   setattrphone_storer"   )monkeypatchfakes   & r   _wirer2   #   s$    9D^T\\BKr   c                    V P                  R R4       V P                  RRR7       \        P                  q! 4       pRq2V8H  qD'       g   \        P
                  ! RV3RW#34      RR\        P                  ! 4       9   g!   \        P                  ! \        4      '       d   \        P                  ! \        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;rCV P                  RR4       \        P                  q! 4       pRq2V8H  qD'       g   \        P
                  ! RV3RW#34      RR\        P                  ! 4       9   g!   \        P                  ! \        4      '       d   \        P                  ! \        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;rCR# )MEMORY_GROUPahmedPHONE_STORE_GROUPF)raisingahmed_phonepy0r/   py2py4py7assert %(py9)spy9N	custom_ns==)zJ%(py4)s
{%(py4)s = %(py2)s
{%(py2)s = %(py0)s.phone_group
}()
} == %(py7)s)setenvdelenvr/   phone_group
@pytest_ar_call_reprcompare@py_builtinslocals_should_repr_global_name	_safereprAssertionError_format_explanationr0   @py_assert1@py_assert3@py_assert6@py_assert5@py_format8@py_format10s   &      r   %test_phone_group_default_and_overriderT   )   sM   ~w/*E:""5"$5555555$555555;5555;555"555$55555555555*K8""3"$3333333$333333;3333;333"333$33333333333r   c                   "   \        V 4       \        P                  ! \        P                  R RRR/4      G Rj  xL
  \        P                  ! \        P                  R4      G Rj  xL
 p. q!q1'       d   VR,          pRqTV8H  qfpV'       Eg"   RRR\
        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MR/,          qrP                  V4       V'       dk   \        P                  ! RX3RXX34      R	\        P                  ! V4      R
\        P                  ! V4      /,          pRRV/,          qP                  V	4       \        P                  ! V^ 4      / ,          p
RRV
/,          p\        \        P                  ! V4      4      hR;p;p;p;reVR,          q3'       g?   RR\        P                  ! V4      /,          p\        \        P                  ! V4      4      hRp\        P                  ! \        P                  4      G Rj  xL
 p\!        V4      p^qV8H  qD'       Eg   \        P                  ! RV3RW34      RR\
        P                  ! 4       9   g!   \        P                  ! \         4      '       d   \        P                  ! \         4      MR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;rOR#  EL7 EL ELG5i)labelzwork officeaddresszKing Fahd RdNzWORK OFFICEz%(py2)sr:   gotpy5py8z%(py10)spy10zassert %(py13)spy13_idzassert %(py1)spy1r9   lenitemspy3py6assert %(py8)sr@   )z%(py5)s == %(py8)sz0%(py3)s
{%(py3)s = %(py0)s(%(py1)s)
} == %(py6)s)r2   r/   put_item
KIND_PLACEget_itemrG   rH   rE   rI   rJ   r   rF   _format_booloprK   rL   
list_itemsr_   )r0   rX   rN   @py_assert0@py_assert4@py_assert7rP   @py_format3@py_format9@py_format11@py_format12@py_format14@py_format2r`   @py_assert2rQ   @py_format7s   &                r   test_put_get_list_placeru   1   s    	+


{55 '	>RT T T$$[%;%;]K
KC333y>3^3^3333333333333333333333>^333>333^333333333333333u:::(()?)?@@Eu:?:33uu:T
K AsO   8M:M1,M:'M4(&M:7M:E)M:0M71A1M:#AM:5A=M:4M:7M:c                   "   \        V 4       \        P                  ! \        P                  R RRR/4      G Rj  xL
  \        P                  ! \        P                  R RRR/4      G Rj  xL
  \        P                  ! \        P                  4      G Rj  xL
 p\        V4      p^q2V8H  qD'       Eg   \        P                  ! RV3RW#34      RR\        P                  ! 4       9   g!   \        P                  ! \
        4      '       d   \        P                  ! \
        4      MR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;rCV^ ,          R,          pRqV8H  q"'       gy   \        P                  ! RV3RWx34      R	\        P                  ! V4      R\        P                  ! V4      /,          p	RRV	/,          p\        \        P                  ! V4      4      hR;p;r(R#  EL8 EL
 EL5i)namefathernumber
0500000001NFather
0500000002r9   r_   r^   r`   ra   rb   rc   rZ   r;   assert %(py6)sr@   rd   z%(py1)s == %(py4)s)r2   r/   re   KIND_CONTACTri   r_   rE   rF   rG   rH   rI   rJ   rK   rL   )
r0   r`   rs   rQ   rk   rt   rn   rj   rO   @py_format5s
   &         r   test_put_is_upsert_by_keyr   <   s    	+


{77 &(LIK K K


{77 &(LIK K K(()A)ABBEu:?:33uu:8H---------------------KKBsB   8I;I20I;+I5,+I;I8A1I;
AI;DI;5I;8I;c                   "   \        V 4       \        P                  ! \        P                  R R/4      G Rj  xL
  \        P                  ! \        P                  R4      G Rj  xL
 p^q!V8H  q3'       g   \
        P                  ! RV3RW3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;r2\        P                  ! \        P                  4      G Rj  xL
 p. qvV8H  q"'       gy   \
        P                  ! RV3RWg34      R	\
        P                  ! V4      R
\
        P                  ! V4      /,          pRRV/,          p	\        \
        P                  ! V	4      4      hR;p;r'R#  EL EL L5i)senderBarqNbarqr9   nra   zassert %(py5)srY   r^   r;   r}   rb   r@   )z%(py0)s == %(py3)sr~   )r2   r/   re   KIND_SMS_WATCHdelete_itemrE   rF   rG   rH   rI   rJ   rK   rL   ri   )
r0   r   rs   rN   @py_format4@py_format6rj   rO   r   rt   s
   &         r   test_delete_itemr   G   s     	+


{99Hf;M
NNN%%k&@&@&IIAM6MMMM1MMMMMM1MMMM1MMMMMMMMMMM''(B(BCCIrIrIIIIICIIICIIIrIIIIIIII OICs<   6G*G",G*%G%&A!G*B	G*G(BG*%G*(G*c                   "   \        V 4       \        P                  ! \        P                  R RRR/4      G Rj  xL
  \        P                  ! \        P                  RRRR/4      G Rj  xL
  \        P
                  ! \        P                  4      G Rj  xL
 p\        V4      p^q2V8H  qD'       g   \        P                  ! RV3RW#34      RR	\        P                  ! 4       9   g!   \        P                  ! \        4      '       d   \        P                  ! \        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;rC\        P
                  ! \        P                  4      G Rj  xL
 p\        V4      p^q2V8H  qD'       g   \        P                  ! RV3RW#34      RR	\        P                  ! 4       9   g!   \        P                  ! \        4      '       d   \        P                  ! \        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;rCR#  EL ELh EL? EL5i)rV   gymrW   ANrw   ry   
0501112222r9   r_   r:   r;   r<   r=   r>   r@   )z0%(py4)s
{%(py4)s = %(py0)s(%(py2)s)
} == %(py7)s)r2   r/   re   rf   r   ri   r_   rE   rF   rG   rH   rI   rJ   rK   rL   rM   s   &      r   test_put_isolated_by_kindr   O   s    	+


{55 '	3?A A A


{77 &xFH H H !++K,B,BCCI3CDIIIIIIIDIIIIII3IIII3IIICIIIDIIIIIIIIIII ++K,D,DEEK3EFK!K!KKKKKFKKKKKK3KKKK3KKKEKKKFKKK!KKKKKKKKAH DEsU   8KK0K+K,+KKA0K	B=KKA0K8BKKKKc                 t  "   \        V 4        \        P                  ! \        P                  R R/4      G Rj  xL
  Rq'       gZ   \
        P                  ! R4      R,           R\
        P                  ! T4      /,          p\        \
        P                  ! T4      4      hRpR#  Lj  \         d     R# i ; i5i)rW   xNFz(put_item must reject a missing key fieldz
>assert %(py1)sr^   )
r2   r/   re   rf   
ValueErrorrE   _format_assertmsgrJ   rK   rL   )r0   rj   rr   s   &  r   test_put_requires_key_fieldr   Z   s}     	+"";#9#9Is;KLLL <5<<<<<<<5<<<<<< 	M s8   B8*B& B$B& A&B8$B& &B51B84B55B8c                  6   \         P                  p R pR .q ! W4      q3'       g   RRR\        P                  ! 4       9   g!   \        P
                  ! \         4      '       d   \        P                  ! \         4      MRR\        P                  ! V 4      R\        P                  ! V4      R\        P                  ! V4      R\        P                  ! V4      /,          p\        \        P                  ! V4      4      hR	;p ;p;r#\         P                  p R pR
.q ! W4      q3'       g   RRR\        P                  ! 4       9   g!   \        P
                  ! \         4      '       d   \        P                  ! \         4      MRR\        P                  ! V 4      R\        P                  ! V4      R\        P                  ! V4      R\        P                  ! V4      /,          p\        \        P                  ! V4      4      hR	;p ;p;r#\         P                  p RpR.q ! W4      q3'       g   RRR\        P                  ! 4       9   g!   \        P
                  ! \         4      '       d   \        P                  ! \         4      MRR\        P                  ! V 4      R\        P                  ! V4      R\        P                  ! V4      R\        P                  ! V4      /,          p\        \        P                  ! V4      4      hR	;p ;p;r#\         P                  p RpRR.q ! W4      q3'       * qU'       g   RRR\        P                  ! 4       9   g!   \        P
                  ! \         4      '       d   \        P                  ! \         4      MRR\        P                  ! V 4      R\        P                  ! V4      R\        P                  ! V4      R\        P                  ! V4      /,          p\        \        P                  ! V4      4      hR	;p ;p;p;r5\         P                  p RpR.q ! W4      q3'       * qU'       g   RRR\        P                  ! 4       9   g!   \        P
                  ! \         4      '       d   \        P                  ! \         4      MRR\        P                  ! V 4      R\        P                  ! V4      R\        P                  ! V4      R\        P                  ! V4      /,          p\        \        P                  ! V4      4      hR	;p ;p;p;r5\         P                  p Rp. q ! W4      q3'       * qU'       g   RRR\        P                  ! 4       9   g!   \        P
                  ! \         4      '       d   \        P                  ! \         4      MRR\        P                  ! V 4      R\        P                  ! V4      R\        P                  ! V4      R\        P                  ! V4      /,          p\        \        P                  ! V4      4      hR	;p ;p;p;r5R	# )z
SNB-AlAhli zVassert %(py8)s
{%(py8)s = %(py2)s
{%(py2)s = %(py0)s.sms_matches
}(%(py4)s, %(py6)s)
}r9   r/   r:   r;   rb   rZ   Nsnbanything*r   SNBAramexzZassert not %(py8)s
{%(py8)s = %(py2)s
{%(py2)s = %(py0)s.sms_matches
}(%(py4)s, %(py6)s)
})	r/   sms_matchesrG   rH   rE   rI   rJ   rK   rL   )rN   rO   rQ   rl   rn   @py_assert9rS   s          r   -test_sms_matches_exact_substring_and_wildcardr   c   sX   ""@<@,@"<@@@@@@@@@;@@@@;@@@"@@@<@@@@@@@@@@@@@@""9<9%9"<999999999;9999;999"999<99999999999999""5:5u5":555555555;5555;555"555:555u55555555555&&AvAx/@A&vAAAAAAAAAAA{AAAA{AAA&AAAvAAA/@AAAAAAAAAAA&&1r1C51&r11111111111{1111{111&111r111511111111111&&2v2r2&v22222222222{2222{222&222v222r22222222222r   )r(   builtinsrG   _pytest.assertion.rewrite	assertionrewriterE   r/   r   r2   rT   ru   r   r   r   r   r    r   r   <module>r      sF   #     :4.JL=3r   