
    Ki{                         S SK r S SKrS SKJr  S SKJr  S SKJrJrJr  S SK	r	S SK
r
S SKJr  S SKJr  S SKJr  S SKJr  S S	KJrJr  S S
KJr   " S S\R.                  5      rg)    N)datetime)uuid4)get_context_session_idset_context_sessionnew_context)parameterizedClient)APIError)FAKE_TEST_API_KEY)FeatureFlagLegacyFlagMetadata)VERSIONc                      \ rS rSr\S 5       r\S 5       rS rS rS r	S r
S rS	 rS
 rS rS rS rS rS rS rS rS r\R.                  " S5      S 5       r\R.                  " S5      S 5       r\R.                  " S5      S 5       r\R.                  " S5      S 5       r\R.                  " S5      S 5       r\R.                  " S5      S 5       r\R.                  " S5      S 5       rS rS r S r!S r"S  r#S! r$S" r%S# r&S$ r'S% r(S& r)S' r*S( r+S) r,S* r-S+ r.S, r/\0Rb                  " S-S.0 0 4S/S0S1S2S3S4.S1S2S3S4.4S5\2" \3" 5       5      0 0 4S6S70 0 4S8S90 0 4S:S;0 0 4/5      S< 5       r4S= r5S> r6S? r7\0Rb                  " S@SASBSCSD0SCSD04SESFSGSHSISJSK./SL.SMSH04SNSOSPSQSRS1SSSRST.SQSRS1SSSRST.4SUSVSWSXSQS2SYSQSZS[S\.SXSQS2SYSQSZS[S\.4/5      S] 5       r8\0Rb                  " S^S_S`Sa.SbS_ScS`04SdS`SXSe.SfSfS`SXSe.4Sg0 ShSh0 4SiSjS`Sk.SlSlSjS`Sk.4/5      Sm 5       r9Sn r:So r;Sp r<Sq r=Sr r>Ss r?St r@Su rASv rBSw rCSx rDSy rE\R.                  " S5      Sz 5       rFS{ rGS| rHS} rIS~ rJ\R.                  " S5      S 5       rK\R.                  " S5      \R.                  " S5      S 5       5       rL\R.                  " S5      S 5       rM\0Rb                  " SSSSSSSSSSSSS04
/5      S 5       rN\R.                  " S5      S 5       rOS rPS rQS rRS rSS rTSrUg)
TestClient   c                     [         R                  " S5      U l        [         R                  " S5      U l        U R                  R	                  5         U R                  R	                  5         g )Nzposthog.client.batch_postposthog.consumer.batch_post)mockpatchclient_post_patcherconsumer_post_patcherstartclss    Z/var/www/html/dynamic-report/venv/lib/python3.13/site-packages/posthog/test/test_client.py
setUpClassTestClient.setUpClass   sL     #'**-H"I$(JJ/L$M!%%'!!'')    c                 l    U R                   R                  5         U R                  R                  5         g N)r   stopr   r   s    r   tearDownClassTestClient.tearDownClass   s&    $$&!!&&(r   c                 *    [        SX5        SU l        g)zMark the failure handlerFAILTN)printfailed)selfebatchs      r   set_failTestClient.set_fail    s    far   c                 L    SU l         [        [        U R                  S9U l        g )NF)on_error)r(   r
   r   r,   clientr)   s    r   setUpTestClient.setUp%   s    .Gr   c                 8    U R                  [        [        5        g r!   )assertRaisesAssertionErrorr
   r1   s    r   test_requires_api_key TestClient.test_requires_api_key)   s    .&1r   c                 8    U R                   R                  5         g r!   )r0   flushr1   s    r   test_empty_flushTestClient.test_empty_flush,   s    r   c                    U R                   nUR                  SS5      u  p#UR                  5         U R                  U5        U R	                  U R
                  5        U R                  US   S5        U R                  [        US   [        5      5        U R                  UR                  S5      5        U R                  US   S5        U R                  US   S   S5        U R                  US   S	   [        5        US   S
   [        R                  :X  d   eUS   S   [        R                  :X  d   eUS   S   [        R                  :X  d   eUS   S   [        R                  :X  d   eg )Ndistinct_idpython test eventevent	timestampuuid
properties$libposthog-python$lib_version$python_runtime$python_version$os$os_version)r0   capturer:   
assertTrueassertFalser(   assertEqual
isinstancestrassertIsNonegetr   r   ANYr)   r0   successmsgs       r   test_basic_captureTestClient.test_basic_capture/   sD   ~~m5HI %W':;
3{#3S9:#''&/*]+];\*624DE\*>:GD< !23txx???< !23txx???< '488333< /488;;;r   c                 
   U R                   n[        [        5       5      nUR                  SSUS9u  p4UR	                  5         U R                  U5        U R                  U R                  5        U R                  US   S5        U R                  [        US   [        5      5        U R                  US   U5        U R                  US   S5        U R                  US   S   S	5        U R                  US   S
   [        5        g )Nr>   r?   )rB   r@   rA   rB   rC   rD   rE   rF   )r0   rP   r   rK   r:   rL   rM   r(   rN   rO   r   )r)   r0   rB   rU   rV   s        r   test_basic_capture_with_uuid'TestClient.test_basic_capture_with_uuidB   s    57|~~m5Ht~T %W':;
3{#3S9:Vd+]+];\*624DE\*>:GDr   c                    [        [        U R                  S9nUR                  SS5      u  p#UR	                  5         U R                  U5        U R                  U R                  5        U R                  US   S5        U R                  [        US   [        5      5        U R                  UR                  S5      5        U R                  US   S5        U R                  US   S   S	5        U R                  US   S
   [        5        g )N)project_api_keyr/   r>   r?   r@   rA   rB   rC   rD   rE   rF   )r
   r   r,   rK   r:   rL   rM   r(   rN   rO   rP   rQ   rR   r   rT   s       r   'test_basic_capture_with_project_api_key2TestClient.test_basic_capture_with_project_api_keyQ   s    (9DMMR~~m5HI %W':;
3{#3S9:#''&/*]+];\*624DE\*>:GDr   c                 r   [        [        SS0S9nUR                  SS5      u  p#UR                  5         U R	                  US   S5        U R	                  US   S   S5        UR                  SSS	05      u  p#UR                  5         U R	                  US
   S   S	5        U R	                  US   S   S5        g )Nsourcez	repo-namesuper_propertiesr>   r?   r@   rC   traitvalue$set)r
   r   rK   r:   rN   identifyr)   r0   _rV   s       r   test_basic_super_properties&TestClient.test_basic_super_properties`   s    )X{<ST/BCW':;\*84kB'0BCVW-w7\*84kBr   c                 t   [         R                  R                  [        SS S9 nU R                  n[        S5      nUR                  USS9  U R                  UR                  5        UR                  S   nU R                  US   S5        U R                  US   S5        S S S 5        g ! , (       d  f       g = f)	NrK   return_valuetest exceptionr>   r>   r      
$exceptionr   r   objectr
   r0   	Exceptioncapture_exceptionrL   called	call_argsrN   r)   patch_capturer0   	exceptioncapture_calls        r   test_basic_capture_exception'TestClient.test_basic_capture_exceptiono   s    ZZvytD[[F!"23I$$YM$JOOM001(2215L\!_m<\!_l; EDDs   A<B))
B7c                 x   [         R                  R                  [        SS S9 nU R                  n[        S5      nUR                  US5        U R                  UR                  5        UR                  S   nU R                  US   S5        U R                  US   S5        S S S 5        g ! , (       d  f       g = f)NrK   rm   ro   r>   r   rq   rr   rs   ry   s        r   -test_basic_capture_exception_with_distinct_id8TestClient.test_basic_capture_exception_with_distinct_idz   s    ZZvytD[[F!"23I$$Y>OOM001(2215L\!_m<\!_l; EDDs   A>B++
B9c                    [         R                  R                  [        SS S9 n[        [        U R
                  SS9n[        S5      nUR                  US5        U R                  UR                  5        UR                  S   nU R                  US   S5        U R                  US   S	5        S S S 5        g ! , (       d  f       g = f)
NrK   rm   zhttps://aloha.comr/   hostro   r>   r   rq   rr   r   r   rt   r
   r   r,   ru   rv   rL   rw   rx   rN   ry   s        r   9test_basic_capture_exception_with_correct_host_generationDTestClient.test_basic_capture_exception_with_correct_host_generation   s    ZZvytD!DMM@SF ""23I$$Y>OOM001(2215L\!_m<\!_l; EDD   BB88
Cc                    [         R                  R                  [        SS S9 n[        [        U R
                  SS9n[        S5      nUR                  US5        U R                  UR                  5        UR                  S   nU R                  US   S5        U R                  US   S	5        S S S 5        g ! , (       d  f       g = f)
NrK   rm   https://app.posthog.comr   ro   r>   r   rq   rr   r   ry   s        r   Jtest_basic_capture_exception_with_correct_host_generation_for_server_hostsUTestClient.test_basic_capture_exception_with_correct_host_generation_for_server_hosts   s     ZZvytD!.F
 ""23I$$Y>OOM001(2215L\!_m<\!_l; EDDr   c                    [         R                  R                  [        SS S9 nU R                  n [        S5      e! [
         a    UR                  SS9   Of = fU R                  UR                  5        UR                  S   nU R                  US   S5        U R                  US   S5        U R                  US	   S
   S5        U R                  US	   S   S5        U R                  US	   S   S   S   S   S5        U R                  US	   S   S   S   S   S5        U R                  US	   S   S   S   S 5        U R                  US	   S   S   S   S5        U R                  US	   S   S   S   S5        U R                  US	   S   S   S   S   S5        U R                  US	   S   S   S   S   S   S   S5        U R                  US	   S   S   S   S   S   S   S5        U R                  US	   S   S   S   S   S   S   S5        U R                  US	   S   S   S   S   S   S   S5        S S S 5        g ! , (       d  f       g = f)NrK   rm   ro   r>   rp   r   rq   rr      z$exception_typeru   z$exception_messagez$exception_list	mechanismtypegenerichandledTmodulere   
stacktracerawframesfilenamezposthog/test/test_client.pyfunction4test_basic_capture_exception_with_no_exception_givenzposthog.test.test_clientin_apprs   )r)   rz   r0   r|   s       r   r   ?TestClient.test_basic_capture_exception_with_no_exception_given   s   ZZvytD[[FD 011 D((](CD OOM001(2215L\!_m<\!_l;\!_->?M\!_-ABDTUQ 1215kB6JI Q 1215kB9Mt \!_->?B8LdS\!_->?B6JKXQ 1215g>@P Q 1215lCFK Q 1215lCHMaP .	 Q 1215lCHMaP G	 Q 1215lCHMaP +	 Q 1215lCHMaP 	] EDDs'   I=AIAG I
Ic                 ~   [         R                  R                  [        SS S9 nU R	                  SSS9 nU R
                  nUR                  5         U R                  UR                  5        U R                  UR                  S   S5        S S S 5        S S S 5        g ! , (       d  f       N= f! , (       d  f       g = f)NrK   rm   posthogWARNINGlevelr   z2WARNING:posthog:No exception information available)r   r   rt   r
   
assertLogsr0   rv   rM   rw   rN   output)r)   rz   logsr0   s       r   8test_basic_capture_exception_with_no_exception_happeningCTestClient.test_basic_capture_exception_with_no_exception_happening   s    ZZvytD)<((*  !5!56  KKNH = ED<< EDs#   B.ABB.
B+	'B..
B<c                 8   [        [        SS9nU R                  SSS9 nUR                  [	        S5      SSS	9  U R                  UR                  S
   S5        U R                  [        UR                  S
   S5      S5        S S S 5        g ! , (       d  f       g = f)NT)log_captured_exceptionsr   ERRORr   ro   r>   zone/two/three)pathr   z+ERROR:posthog:test exception
NoneType: Noner   )	r
   r   r   rv   ru   rN   r   getattrrecords)r)   r0   r   s      r   (test_capture_exception_logs_when_enabled3TestClient.test_capture_exception_logs_when_enabled   s    )4H__Yg_6$$$*+] %  A N WT\\!_f=O 766s   A#B
Bzposthog.client.flagsc                    SSS00Ul         [        [        U R                  [        S9nUR	                  SSSS9u  p4UR                  5         U R                  U5        U R                  U R                  5        U R                  US	   S5        U R                  [        US
   [        5      5        U R                  UR                  S5      5        U R                  US   S5        U R                  US   S   S5        U R                  US   S   [        5        U R                  US   S   S5        U R                  US   S   S/5        U R                  UR                  S5        g )NfeatureFlagsbeta-featurerandom-variantr/   personal_api_keyr>   r?   Tsend_feature_flagsr@   rA   rB   rC   rD   rE   rF   $feature/beta-feature$active_feature_flagsrq   rn   r
   r   r,   rK   r:   rL   rM   r(   rN   rO   rP   rQ   rR   r   
call_countr)   patch_flagsr0   rU   rV   s        r   %test_basic_capture_with_feature_flags0TestClient.test_basic_capture_with_feature_flags   sQ   $2^EU4V#W ]].

 ~~.4 & 
 	 %W':;
3{#3S9:#''&/*]+];\*624DE\*>:GD\*+BCEUV\*+BCnEUV//3r   c                    SSS00Ul         [        [        U R                  [        S9nSSSSS	S
SSSS./S	S.SS0/SSSSS.SSSS.SSSS./0SSS0S.S.S .nSSS!SS"SS#/SS$./S	S./S%S&0S'.S(.nSSS)S/ S*S./S%S&0S'.S(.nX4U/Ul        UR                  S+S,5      u  pgUR                  5         U R                  U5        U R                  U R                  5        U R                  US-   S,5        U R                  [        US.   [        5      5        U R                  UR                  S/5      5        U R                  US+   S+5        U R                  US0   S1   S25        U R                  US0   S3   [        5        U R                  US0   S4   S5        U R                  US0   S5   S65        U R                  US0   S7   S/5        S8US0   ;  d   eU R                  UR                   S*5        / Ul        UR                  S+S,5      u  pgUR                  5         U R                  U5        U R                  U R                  5        S8US0   ;  d   eS4US0   ;  d   eS5US0   ;  d   eS7US0   ;  d   eg )9Nr   r   r   r   rq   Beta Featurebeta-feature-localTd   emailpersontest@posthog.comexactkeyr   re   operatorrC   rollout_percentager   2   variantsfirst-variantFirst Variantr   namer   second-variantSecond Variant   third-variantThird Variantsome-payloadajsonr   r   groupsmultivariatepayloadsidr   r   activer   filtersperson-flagregionUSAr   r   re   r   true,  r   r   r   r   r   r   r   z
false-flagr   r>   r?   r@   rA   rB   rC   rD   rE   rF   $feature/beta-feature-localz$feature/false-flagFr   r   rn   r
   r   r,   feature_flagsrK   r:   rL   rM   r(   rN   rO   rP   rQ   rR   r   r   )r)   r   r0   multivariate_flag
basic_flag
false_flagrU   rV   s           r   7test_basic_capture_with_locally_evaluated_feature_flagsBTestClient.test_basic_capture_with_locally_evaluated_feature_flags  s<   $2^EU4V#W ]].
 "'"% (/(0);,3	' /2
 -b" #2$324 $4$424 $3$324!!( &4&)6]I(/
b "  (0,3*/(0	' /2
 $SM

. " ')./ $SM

 !2zJ~~m5HI %W':;
3{#3S9:#''&/*]+];\*624DE\*>:GD;<o	
 	\*+@A5I569M8N	
 'c,.????//3  "~~m5HI %&c,.????,C4EEEE$C,====&c,.????r   zposthog.client.getc                    SSSS.n[        SUS   5      Ul        [        [        SS9nU R	                  S	S
S9 nUR                  5         U R                  UR                  / 5        U R                  UR                  0 5        U R                  UR                  0 5        U R                  UR                  0 5        U R                  SUR                  S   5        S S S 5        g ! , (       d  f       g = f)Nquota_limitedz1You have exceeded your feature flag request quotapayment_required)r   detailcodei  r   testr   r   r   r   z#PostHog feature flags quota limitedr   )r   side_effectr
   r   r   _load_feature_flagsrN   r   feature_flags_by_keygroup_type_mappingcohortsassertInr   )r)   	patch_getmock_responser0   r   s        r   %test_load_feature_flags_quota_limited0TestClient.test_load_feature_flags_quota_limited  s     $I&

 !)mH.E F	)FC__Yi_8D&&(V1126V88"=V66;V^^R0MM?QP 988s   B C""
C0c                    SSS00Ul         [        [        U R                  [        S9nSSSSS	S
SSSS./S	S.SS0/SSSSS.SSSS.SSSS./0SSS0S.S.S .nSSS!SS"SS#/SS$./S	S./S%S&0S'.S(.nX4/Ul        UR                  S)S*S+S,05      u  pVUR                  5         U R                  U5        U R                  U R                  5        U R                  US-   S*5        U R                  [        US.   [        5      5        U R                  UR                  S/5      5        U R                  US)   S)5        U R                  US0   S1   S25        U R                  US0   S3   [        5        U R                  US0   S+   S,5        U R                  US0   S4   S/5        S5US0   ;  d   eS6US0   ;  d   eU R                  UR                   S75        g )8Nr   r   r   r   rq   r   r   Tr   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r>   r?   r   zmy-custom-variantr@   rA   rB   rC   rD   rE   rF   r   r   z$feature/person-flagr   r   )r)   r   r0   r   r   rU   rV   s          r   +test_dont_override_capture_with_local_flags6TestClient.test_dont_override_capture_with_local_flags  s|   $2^EU4V#W ]].
 "'"% (/(0);,3	' /2
 -b" #2$324 $4$424 $3$324!!( &4&)6]I(/
b "  (0,3*/(0	' /2
 $SM

, !2>~~*,?@

 	 %W':;
3{#3S9:#''&/*]+];\*624DE\*>:GD;<>Q	
 	569M8N	
 'c,.????%S->>>>//3r   c                 \   SSSSS.0Ul         [        [        U R                  [        S9nUR	                  SSSS	9u  p4UR                  5         U R                  U5        U R                  U R                  5        U R                  US
   S5        U R                  [        US   [        5      5        U R                  UR                  S5      5        U R                  US   S5        U R                  US   S   5        U R                  US   S   S5        U R                  US   S   [        5        U R                  US   S   S5        U R                  US   S   S5        U R                  US   S   SS/5        U R                  UR                  S5        UR!                  SSSS0 S S SS9  g )Nr   r   TFr   alpha-featureoff-featurer   r>   r?   r   r@   rA   rB   rC   $geoip_disablerD   rE   rF   r   $feature/alpha-featurer   r   r  rq   
random_keyhttps://us.i.posthog.com   timeoutr>   r   person_propertiesgroup_propertiesgeoip_disablern   r
   r   r,   rK   r:   rL   rM   r(   rN   rO   rP   rQ   rR   r   r   assert_called_withr   s        r   9test_basic_capture_with_feature_flags_returns_active_onlyDTestClient.test_basic_capture_with_feature_flags_returns_active_only
  s     0!%$$
  ]].

 ~~.4 & 
 	 %W':;
3{#3S9:#''&/*]+];L)*:;<\*624DE\*>:GD\*+BCEUV\*+CDdK56_-	

 	//3&&&%"! 	' 		
r   c                 d   SSSSS.0Ul         [        [        SU R                  [        SSS9nUR	                  S	S
SSS9u  p4UR                  5         U R                  U5        U R                  U R                  5        U R                  US   S
5        U R                  [        US   [        5      5        U R                  UR                  S5      5        U R                  SUS   ;  5        U R                  US	   S	5        U R                  US   S   S5        U R                  US   S   [        5        U R                  US   S   S5        U R                  US   S   S5        U R                  US   S   SS/5        U R                  UR                  S5        UR!                  SSSS	0 S S SS9  g )Nr   r   TFr  r      )r   r/   r   disable_geoip%feature_flags_request_timeout_secondsr>   r?   )r   r  r@   rA   rB   r
  rC   rD   rE   rF   r   r  r   r   r  rq   r  r  r  r  r   s        r   Itest_basic_capture_with_feature_flags_and_disable_geoip_returns_correctlyTTestClient.test_basic_capture_with_feature_flags_and_disable_geoip_returns_correctly:  s   
  0!%$$
  *]].24
 ~~#	 & 
 	 %W':;
3{#3S9:#''&/*(L0AAB]+];\*624DE\*>:GD\*+BCEUV\*+CDdK56_-	

 	//3&&&%"! 	' 		
r   c                    SSS00Ul         [        [        U R                  [        S9nUR	                  SSSS9u  p4UR                  5         U R                  U5        U R                  U R                  5        U R                  US	   S5        U R                  [        US
   [        5      5        U R                  UR                  S5      5        U R                  US   S5        U R                  US   S   S5        U R                  US   S   [        5        U R                  SUS   ;  5        U R                  SUS   ;  5        U R                  UR                  S5        g )Nr   r   r   r   r>   r?   Fr   r@   rA   rB   rC   rD   rE   rF   r   r   r   r   r   s        r   Ctest_basic_capture_with_feature_flags_switched_off_doesnt_send_themNTestClient.test_basic_capture_with_feature_flags_switched_off_doesnt_send_themr  sG    %3^EU4V#W ]].

 ~~.5 & 
 	 %W':;
3{#3S9:#''&/*]+];\*624DE\*>:GD/s<7HHI/s<7HHI//3r   c                     U R                   nUR                  SSS9u  p#UR                  5         U R                  U5        U R	                  U R
                  5        U R                  US   S5        g )Nl   IqKr?   )r>   r@   r>   157963456373623802)r0   rK   r:   rL   rM   r(   rN   rT   s       r   test_stringifies_distinct_id'TestClient.test_stringifies_distinct_id  sg     ~~*2E & 
 	 %]+-ABr   c           
         U R                   nUR                  SSSS0[        SSS5      SS	9u  p#U R                  U5        U R	                  US
   S5        U R	                  US   S   S5        U R	                  US   S5        U R	                  US   S   S5        U R	                  US   S   [
        5        U R	                  US   S5        U R	                  US   S5        U R                  SUS   ;  5        g )Nr>   r?   propertyre     	   r  new-uuidrA   rB   rA   2014-09-03T00:00:00+00:00rC   r@   rD   rE   rF   rB   $groups)r0   rK   r   rL   rN   r   rT   s       r   test_advanced_capture TestClient.test_advanced_capture  s   ~~!tQ* & 
 	 [)+FG\*:6@W':;\*624DE\*>:GDVj1]+];	\)::;r   c                     U R                   R                  SSSSS.S9u  pU R                  U5        U R                  US   S   SSS.5        g )	Nr>   
test_eventid:5app.posthog.comcompanyinstance)r   rC   r,  )r0   rK   rL   rN   r)   rU   rV   s      r   test_groups_captureTestClient.test_groups_capture  s^    {{**%3DE + 
 	 i(,=>	
r   c                    U R                   nUR                  SSS05      u  p#UR                  5         U R                  U5        U R	                  U R
                  5        U R                  US   S   S5        U R                  [        US   [        5      5        U R                  UR                  S5      5        U R                  US   S5        g Nr>   rd   re   rf   rA   rB   )r0   rg   r:   rL   rM   r(   rN   rO   rP   rQ   rR   rT   s       r   test_basic_identifyTestClient.test_basic_identify  s    }w6HI %VW-w7
3{#3S9:#''&/*]+];r   c           	         U R                   nUR                  SSS0[        SSS5      SS9u  p#U R                  U5        U R	                  US	   S
5        U R	                  US   S   S5        U R	                  US   S   S5        U R	                  US   S   [
        5        U R                  [        US	   [        5      5        U R	                  US   S5        U R	                  US   S5        g Nr>   rd   re   r'  r(  r  r)  r*  rA   r+  rf   rC   rD   rE   rF   rB   )r0   rg   r   rL   rN   r   rO   rP   rT   s       r   test_advanced_identify!TestClient.test_advanced_identify  s    gtQ*	 ' 
 	 [)+FGVW-w7\*624DE\*>:GD
3{#3S9:Vj1]+];r   c                    U R                   nUR                  SSS05      u  p#UR                  5         U R                  U5        U R	                  U R
                  5        U R                  US   S   S5        U R                  [        US   [        5      5        U R                  UR                  S5      5        U R                  US   S5        g r:  )r0   setr:   rL   rM   r(   rN   rO   rP   rQ   rR   rT   s       r   test_basic_setTestClient.test_basic_set  s    zz-'71CD %VW-w7
3{#3S9:#''&/*]+];r   c           	         U R                   nUR                  SSS0[        SSS5      SS9u  p#U R                  U5        U R	                  US	   S
5        U R	                  US   S   S5        U R	                  US   S   S5        U R	                  US   S   [
        5        U R                  [        US	   [        5      5        U R	                  US   S5        U R	                  US   S5        g r>  )r0   rB  r   rL   rN   r   rO   rP   rT   s       r   test_advanced_setTestClient.test_advanced_set  s    zzgtQ*	 " 
 	 [)+FGVW-w7\*624DE\*>:GD
3{#3S9:Vj1]+];r   c                    U R                   nUR                  SSS05      u  p#UR                  5         U R                  U5        U R	                  U R
                  5        U R                  US   S   S5        U R                  [        US   [        5      5        U R                  UR                  S5      5        U R                  US   S5        g )Nr>   rd   re   	$set_oncerA   rB   )r0   set_oncer:   rL   rM   r(   rN   rO   rP   rQ   rR   rT   s       r   test_basic_set_onceTestClient.test_basic_set_once  s    }w6HI %[)'2G<
3{#3S9:#''&/*]+];r   c           	         U R                   nUR                  SSS0[        SSS5      SS9u  p#U R                  U5        U R	                  US	   S
5        U R	                  US   S   S5        U R	                  US   S   S5        U R	                  US   S   [
        5        U R                  [        US	   [        5      5        U R	                  US   S5        U R	                  US   S5        g )Nr>   rd   re   r'  r(  r  r)  r*  rA   r+  rI  rC   rD   rE   rF   rB   )r0   rJ  r   rL   rN   r   rO   rP   rT   s       r   test_advanced_set_once!TestClient.test_advanced_set_once  s    gtQ*	 ' 
 	 [)+FG[)'2G<\*624DE\*>:GD
3{#3S9:Vj1]+];r   c           
      z   U R                   R                  SS5      u  pU R                  U5        U R                  US   S5        U R                  US   S5        U R                  US   SS0 S[        S	S
.5        U R                  [        US   [        5      5        U R                  UR                  S5      5        g )Norganizationr1  r@   $groupidentifyr>   $organization_id:5rC   rE   Tz$group_type
$group_keyz
$group_setrD   rF   r
  rA   rB   	r0   group_identifyrL   rN   r   rO   rP   rQ   rR   r6  s      r   test_basic_group_identify$TestClient.test_basic_group_identify  s    {{11.&I W'78]+-AB-$ ( '"&
	
 	
3{#3S9:#''&/*r   c           
      x   U R                   R                  SSSS9u  pU R                  U5        U R                  US   S5        U R                  US   S5        U R                  US   SS0 S[        S	S
.5        U R                  [        US   [        5      5        U R                  UR                  S5      5        g )NrQ  r1  r>   rp   r@   rR  rC   rE   TrT  rA   rB   rV  r6  s      r   *test_basic_group_identify_with_distinct_id5TestClient.test_basic_group_identify_with_distinct_id/  s    {{11F 2 
 	 W'78]+];-$ ( '"&
	
 	
3{#3S9:#''&/*r   c           
      @   U R                   R                  SSSS0[        SSS5      SS	9u  pU R                  U5        U R	                  US
   S5        U R	                  US   S5        U R	                  US   SSSS0S[
        SS.5        U R	                  US   S5        g )NrQ  r1  rd   re   r'  r(  r  r)  r*  r@   rR  r>   rS  rC   rE   TrT  rA   r+  r0   rW  r   rL   rN   r   r6  s      r   test_advanced_group_identify'TestClient.test_advanced_group_identifyD  s    {{11gtQ* 2 
 	 W'78]+-AB-$&0( '"&
	
 	[)+FGr   c           
      B   U R                   R                  SSSS0[        SSS5      SS	S
9u  pU R                  U5        U R	                  US   S5        U R	                  US	   S	5        U R	                  US   SSSS0S[
        SS.5        U R	                  US   S5        g )NrQ  r1  rd   re   r'  r(  r  r)  r>   )rA   rB   r>   r@   rR  rC   rE   TrT  rA   r+  r^  r6  s      r   -test_advanced_group_identify_with_distinct_id8TestClient.test_advanced_group_identify_with_distinct_id]  s    {{11gtQ*% 2 
 	 W'78]+];-$&0( '"&
	
 	[)+FGr   c                    U R                   nUR                  SS5      u  p#UR                  5         U R                  U5        U R	                  U R
                  5        U R                  US   S   S5        U R                  US   S   S5        g )N
previousIdr>   rC   alias)r0   rf  r:   rL   rM   r(   rN   rT   s       r   test_basic_aliasTestClient.test_basic_aliasx  sx    ||L-@ %\*=9<H\*73]Cr   c                    U R                   nUR                  SSS9u  p#U R                  U R                  5        UR	                  5         U R                  U5        U R                  US   S5        U R                  US   S   S5        g )Nr>   https://posthog.com/contacturlrC   $current_url)r0   pagerM   r(   r:   rL   rN   rT   s       r   test_basic_pageTestClient.test_basic_page  sz    {{=6S{T% ]+];n-/L	
r   c                 8   U R                   n[        5       nUR                  USS9u  p4U R                  U R                  5        UR                  5         U R                  U5        U R                  US   [        U5      5        U R                  US   S   S5        g )Nrj  rk  r>   rC   rm  )	r0   r   rn  rM   r(   r:   rL   rN   rP   )r)   r0   r>   rU   rV   s        r   test_basic_page_distinct_uuid(TestClient.test_basic_page_distinct_uuid  s    g{{;4Q{R% ]+S-=>n-/L	
r   c           
         U R                   nUR                  SSSS0[        SSS5      SS	9u  p#U R                  U5        U R	                  US
   S5        U R	                  US   S   S5        U R	                  US   S   S5        U R	                  US   S   S5        U R	                  US   S   [
        5        U R                  [        US
   [        5      5        U R	                  US   S5        U R	                  US   S5        g )Nr>   rj  r&  re   r'  r(  r  r)  r*  rA   r+  rC   rm  rD   rE   rF   rB   )r0   rn  r   rL   rN   r   rO   rP   rT   s       r   test_advanced_pageTestClient.test_advanced_page  s   {{)!tQ* # 
 	 [)+FGn-/L	
 	\*:6@\*624DE\*>:GD
3{#3S9:Vj1]+];r   basic_session_idztest-session-123 session_id_with_other_propertiesztest-session-456custom_valueFzhttps://example.com)custom_prop$process_person_profilerm  session_id_uuid_formatsession_id_numeric_string
1234567890session_id_empty_string session_id_with_special_charszsession-123_test.idc                    U R                   nSU0UEnUR                  SSUS9u  pxUR                  5         U R                  U5        U R	                  U R
                  5        U R                  US   S5        U R                  US   S5        U R                  US   S   U5        U R                  US   S   S5        U R                  US   S	   [        5        UR                  5        H  u  pU R                  US   U	   U
5        M     g )
N$session_idr>   r?   rC   r@   rC   rD   rE   rF   )	r0   rK   r:   rL   rM   r(   rN   r   items)r)   	test_name
session_idadditional_propertiesexpected_propertiesr0   rC   rU   rV   r   re   s              r   'test_capture_with_session_id_variations2TestClient.test_capture_with_session_id_variations  s   6 #ZI3HI
~~.: & 
 	 %W':;]+];\*=9:F\*624DE\*>:GD .335JCS.s3U; 6r   c                     U R                   nSnUR                  SSSU0SSS.S9u  p4UR                  5         U R                  U5        U R	                  US	   S   U5        U R	                  US	   S
   SSS.5        g )Nzgroup-session-101r>   r0  r  r1  r2  r3  )rC   r   rC   r,  r0   rK   r:   rL   rN   r)   r0   r  rU   rV   s        r   %test_session_id_preserved_with_groups0TestClient.test_session_id_preserved_with_groups  s    (
~~%z2%3DE	 & 
 	 \*=9:Fi(,=>	
r   c                     U R                   nSnUR                  SSUSS.S9u  p4UR                  5         U R                  U5        U R	                  US   S   U5        U R	                  US   S	   S5        g )
Nzanonymous-session-202r>   anonymous_eventF)r  r{  r  rC   r  r{  r  r  s        r   $test_session_id_with_anonymous_event/TestClient.test_session_id_with_anonymous_event  s    ,
~~'1eT & 

 	 \*=9:F\*+DEuMr   c                    U R                   nSnUR                  SSUSS.S9u  p4UR                  5         U R                  U5        U R	                  U R
                  5        U R                  US   S5        U R                  US   S5        U R                  US	   S
   U5        U R                  US	   S   S5        U R                  US	   S   S5        g )Nzpage-session-303r>   rj  contactr  	page_typer  r@   z	$pageviewrC   r  rm  r  )r0   rn  r:   rL   rM   r(   rN   r  s        r   test_page_with_session_id$TestClient.test_page_with_session_id   s    '
{{)'1	J # 

 	 %W{3]+];\*=9:Fn-/L	
 	\*;7Cr   screen_eventz$screenzspecial-session-505z$screen_name
HomeScreensurvey_eventzsurvey sentzsurvey-session-606
survey_123q1z#How likely are you to recommend us?)r   question)
$survey_idz$survey_questionsr  complex_properties_eventcomplex_eventzmixed-session-707https://example.com/pageT*   )rm  r{  custom_propertynumeric_propertyboolean_propertycsp_violationz$csp_violationzcsp-session-789z1.0zMozilla/5.0 Test Agentzhttps://malicious.com/script.jsz
script-src)z$csp_versionrm  r{  z$raw_user_agentz$csp_document_urlz$csp_blocked_urlz$csp_violated_directivec                    U R                   nSU0UEnUR                  SX'S9u  pUR                  5         U R                  U5        U R	                  U	S   U5        U R	                  U	S   S   U5        UR                  5        H  u  pU R	                  U	S   U
   U5        M     U R	                  U	S   S   S5        U R	                  U	S   S   [        5        g )	Nr  r>   r  r@   rC   rD   rE   rF   )r0   rK   r:   rL   rN   r  r   )r)   r  
event_namer  r  expected_additional_propertiesr0   rC   rU   rV   r   re   s               r   *test_session_id_with_different_event_types5TestClient.test_session_id_with_different_event_types  s    T #ZI3HI
~~mZ~W Wz2\*=9:F 9>>@JCS.s3U; A 	\*624DE\*>:GDr   $super_properties_override_session_idzsuper-sessionr   )r  ra   zevent-session-808ra   no_super_properties_conflict)ra   versionzevent-session-909empty_super_propertieszevent-session-111(super_properties_with_other_dollar_propszhttps://super.com)rm  ra   zevent-session-222c                    [        [        US9nUR                  SSSU0S9u  pxUR                  5         U R	                  U5        U R                  US   S   U5        UR                  5        H  u  pU R                  US   U	   U
5        M     g )Nrb   r>   r0  r  r  rC   )r
   r   rK   r:   rL   rN   r  )r)   r  rc   event_session_idexpected_session_idexpected_super_propsr0   rU   rV   r   re   s              r   0test_session_id_with_super_properties_variations;TestClient.test_session_id_with_super_properties_variationsq  s    R )<LM~~<]DT4U & 
 	 \*=9;NO /446JCS.s3U; 7r   c                     U R                   n[        S5       H  nUR                  SSS05      u  p4M     UR                  5         U R	                  UR
                  R                  5       5        g Ni  r>   rd   re   )r0   rangerg   r:   rL   queueemptyr)   r0   irU   rV   s        r   
test_flushTestClient.test_flush  sV    tA!??=7G:LMLGS  	**,-r   c                 B   U R                   n[        S5       H  nUR                  SSS05      u  p4M     UR                  5         U R	                  UR
                  R                  5       5        UR                   H"  nU R                  UR                  5       5        M$     g r  )
r0   r  rg   shutdownrL   r  r  	consumersrM   is_alive)r)   r0   r  rU   rV   consumers         r   test_shutdownTestClient.test_shutdown  s~    tA!??=7G:LMLGS  	**,-((HX..01 )r   c                     [        [        SS9nUR                  S5      u  p#U R                  UR                  5        U R                  UR                  R                  5       5        U R                  U5        g )NT)	sync_moder>   )r
   r   rg   rM   r  rL   r  r  )r)   r0   rU   messages       r   test_synchronousTestClient.test_synchronous  sY    )T:!??=9))***,- r   c                     [        [        SS9nUR                  5         [        S5       H  nUR	                  S5        M     UR	                  S5      u  p4U R                  U5        g )Nrq   )max_queue_size
   r>   )r
   r   joinr  rg   rM   r  s        r   test_overflowTestClient.test_overflow  sR    )!<rAOOM*  }5!r   c                 B    [        [        R                  " S5      5        g )Nunicode_key)r
   sixur1   s    r   test_unicodeTestClient.test_unicode  s    suu]#$r   c                     U R                   R                  SS5        U R                   R                  5         U R                  U R                  5        g )Ni  zpython event)r0   rK   r:   rM   r(   r1   s    r   test_numeric_distinct_id#TestClient.test_numeric_distinct_id  s8    D.1%r   c                     [        SSS9  g )Nbad_keyT)debugr	   r1   s    r   
test_debugTestClient.test_debug  s    y%r   c                     [        [        U R                  SS9n[        S5       H  nUR	                  SSS05        M     UR                  5         U R                  U R                  5        g )NT)r/   gzipr  r>   rd   re   )r
   r   failr  rg   r:   rM   r(   )r)   r0   ri   s      r   	test_gzipTestClient.test_gzip  sQ    )DIIDIrAOOMGW+=> %r   c                 T  ^  [        [        T R                  SSS9nU 4S jn[        R                  " SUS9 n[        S5       H  nUR                  SS	S
05        M     [        R                  " S5        T R                  UR                  S5        S S S 5        g ! , (       d  f       g = f)Nr  r  )r/   flush_atflush_intervalc                  B   > TR                  [        US   5      S5        g )Nr+   r  )rN   len)argskwargsr)   s     r   mock_post_fn;TestClient.test_user_defined_flush_at.<locals>.mock_post_fn  s    S126r   r   )r      r>   rd   re   rq   r   )r
   r   r  r   r   r  rg   timesleeprN   r   )r)   r0   r  	mock_postri   s   `    r   test_user_defined_flush_at%TestClient.test_user_defined_flush_at  s    		Bq
	7
 ZZ)|
2Y/AB JJqMY1115
 
 
s   AB
B'c                 ~    [        [        SS9nUR                   H  nU R                  UR                  S5        M!     g )Nr  )r  r
   r   r  rN   r  r)   r0   r  s      r   test_user_defined_timeout$TestClient.test_user_defined_timeout  s5    )26((HX--r2 )r   c                     [        [        5      nUR                   H  nU R                  UR                  S5        M!     g )N   r  r  s      r   test_default_timeout_15"TestClient.test_default_timeout_15  s3    )*((HX--r2 )r   c                     [        [        U R                  SS9nUR                  SS5      u  p#UR	                  5         U R                  U5        U R                  U R                  5        U R                  US5        g )NTr/   disabledr>   r?   r  )r
   r   r,   rK   r:   rM   r(   rN   rT   s       r   test_disabledTestClient.test_disabled  sa    )DMMDQ~~m5HI!%j)r   c                    [        [        U R                  SS9nUR                  SS5      nU R	                  U5        UR                  5         UR                  SS5      nU R	                  U5        UR                  5         UR                  S5      nU R	                  U5        UR                  5         UR                  SS5      nU R	                  U5        UR                  5         UR                  S5      nU R                  US S S.5        UR                  5         U R                  UR                  R                  5       5        g )NTr  r   12345r   )r   featureFlagPayloads)r
   r   r,   get_feature_flagrQ   assert_not_calledfeature_enabledget_all_flagsget_feature_flag_payloadget_all_flags_and_payloadsrN   rL   r  r  )r)   r   r0   responses       r    test_disabled_with_feature_flags+TestClient.test_disabled_with_feature_flags  s   )DMMDQ**>7C(#%%')).'B(#%%'''0(#%%'225'B(#%%'44W=DQU#VW%%' 	**,-r   c                    [        [        U R                  SS9nUR                  SS5      u  p#UR	                  5         U R                  U5        U R                  U R                  5        U R                  US   S5        SUl	        UR                  SS5      u  p#UR	                  5         U R                  U5        U R                  U R                  5        U R                  US5        g )NFr  r>   r?   r@   Tr  )
r
   r   r,   rK   r:   rL   rM   r(   rN   r  rT   s       r   test_enabled_to_disabled#TestClient.test_enabled_to_disabled&  s    )DMMER~~m5HI %W':;~~m5HI!%j)r   c                 *   [        [        U R                  SS9nUR                  SS5      u  p#UR	                  5         U R                  US   S   S5        UR                  SSS05      u  p$UR	                  5         U R                  US   S   S5        g )	NTr/   r  r>   r?   rC   r
  rd   re   )r
   r   r,   rK   r:   rN   rg   r)   r0   ri   capture_msgidentify_msgs        r   $test_disable_geoip_default_on_events/TestClient.test_disable_geoip_default_on_events7  s    )DMMQUV7JK\23CDdK //-'79KLl34DEtLr   c                 .   [        [        U R                  SS9nUR                  SSSS.SS9u  p#UR	                  5         U R                  US	   S
   S5        UR                  SSSS0SS9u  p$UR	                  5         U R                  S
US	   ;  S5        g )NFr  r>   bd)r   cTr  rC   r
  zhttp://a.comrd   re   )r
   r   r,   rB  r:   rN   rn  r  s        r   %test_disable_geoip_override_on_events0TestClient.test_disable_geoip_override_on_eventsA  s    )DMMQVW3/t $ 
 	\23CDdK ++>GW+=U & 
 	)l1KKTRr   c                     [        [        U R                  SS9nUR                  SSSS9u  p#UR	                  5         U R                  SUS   ;  5        g )	NTr  r>   r?   Fr  r
  rC   )r
   r   r,   rK   r:   rL   rh   s       r   2test_disable_geoip_method_overrides_init_on_events=TestClient.test_disable_geoip_method_overrides_init_on_eventsO  sN    )DMMQUV/BRWX(L0AABr   c                    SSSSS.0Ul         [        [        U R                  SS9nUR	                  SSSS	9  UR                  SS
SS0 SS00 SS9  UR                  5         UR                  SSSS	9  UR                  SS
SS0 SS00 SS9  UR                  5         UR                  S5        UR                  SS
SS0 SS00 SS9  g )Nr   r   TFr  r  r  some_idr  r  r  r>   r  feature_enabled_distinct_idall_flags_payloads_id)	rn   r
   r   r,   r  r  
reset_mockr
  r  r)   r   r0   s      r   $test_disable_geoip_default_on_decide/TestClient.test_disable_geoip_default_on_decideU  s$     0!%$$
  )DMMQVWitL&&&!,i8 	' 		
 	 7t 	 	
 	&&&5,.KL 	' 		
 	 ))*AB&&&/,.EF 	' 		
r   zposthog.client.Pollerc                     S nX1R                   R                  l        [        [        SS9nSS0/Ul        U R                  UR                  SS5      5        g )Nc                      [        S5      e)Nzhttp exception)ru    r   r   raise_effect9TestClient.test_call_identify_fails.<locals>.raise_effect  s    ,--r   r   r   r   exampler>   )rn   
raiseErrorr   r
   r   r   rM   r
  )r)   r   
patch_pollr0  r0   s        r   test_call_identify_fails#TestClient.test_call_identify_fails  sT    	. 9E))5)FC!&	 23//	=IJr   c                    SSSSS.0Ul         [        [        SU R                  SS9nUR	                  SS	S
SS.SS0SSS00S9  UR                  SSSS	S
SS.S	SS.S
SS.SS0S.SS9  UR                  5         UR	                  SS	S
SS.SS0SSS00S9  UR                  SSSS	S
SS.SS0SS0SS0S.SS9  UR                  5         UR                  S	0 S S S9  UR                  SSSS	0 SS	00 SS9  g )Nr   r   TFr  zhttp://app2.posthog.com)r   r/   r  r  r&  r1  r2  r3  x1y1r4  xy)r   r  r  r  )r>   r8  )rU  r:  rU  r  r>   overridegroup_override)rn   r
   r   r,   r  r  r)  r  r*  s      r   *test_default_properties_get_added_properly5TestClient.test_default_properties_get_added_properly  s     0!%$$
  *]]	
 	%3DE#Tl'#s4 	  	
 	&&%!%3DE.7tD*0s;)+<=   	' 	
 	 %3DE,j9 "2 	  
	
 	&&%!%3DE,j9(*:;)+<=   	' 	
 	 ))bD4 	* 	
 	&&%!,i8 	' 		
r   )
macOSdarwinr     r  
MockPython3.8.10zMac OS X10.15.7mac_ver)rF  r  r  N)
Windowswin32rB  rD  rE  rH  10	win32_ver)rJ  r  r  r  NLinuxlinuxrB  rD  rE  z20.04Nr  c                    [         R                  " S5       n[         R                  " S5       nXKR                  l        X<l        X,l        U(       a  U	[        X5      l        US:X  a-  [         R                  " SXg4S9   SSKJn  U" 5       nSSS5        OSSKJn  U" 5       nUUUUS	.nWU:X  d   e SSS5        SSS5        g! , (       d  f       N/= f! , (       d  f       N(= f! , (       d  f       g= f)
zATest that we can mock platform and sys for testing system_contextzposthog.client.platformzposthog.client.sysrM  zposthog.client.get_os_inform   r   )system_contextN)rG   rH   rI   rJ   )	r   r   python_implementationrn   version_infoplatformr   posthog.clientrO  )r)   _namesys_platformrQ  expected_runtimeexpected_versionexpected_osexpected_os_versionplatform_methodplatform_returndistro_infomock_platformmock_sysrO  contextexpected_contexts                   r   test_mock_system_context#TestClient.test_mock_system_context  s    n ZZ12m01XCS33@(4%$0! # &5 %"  7*4&1%G B"0"2  >,.G (8'7&#6	$  "2222I 2 32   21 32s;   C%AC>C%C2C%
CC
C"	C%%
C3c                 
   SSSS.SS0SSS.Ul         [        [        5      nS	nS
S0nSS0nUR                  X4U5      nU[	        SSSS [        SS9S9[	        SSS S [        S S9S9[	        SSS S [        S S9S9S.SSS.:X  d   eg )Nr   TFr  r   z{"some": "data"}ztest-id)r   r  errorsWhileComputingFlags	requestIdtest_distinct_idtest_group_typetest_group_idtest_property
test_value)payload)r   enabledvariantreasonmetadatar  r	  )flagsrd  re  )rn   r
   r   get_flags_decisionr   r   )r)   r   r0   r>   r   r  r  s          r   2test_get_decide_returns_normalized_decide_response=TestClient.test_get_decide_returns_normalized_decide_response=  s     !1!%$
 %34F#G)."	$
  )*(#_5,l;,,[BST +& ,/ 2! "-'  / $"  +%! / $ ': */"? 
  
  	
  
r   c                 *   [        5          [        S5        U R                  R                  SSSS05      u  pU R                  R	                  5         U R                  U5        U R                  US   S   S5        S S S 5        g ! , (       d  f       g = f)Nzcontext-session-123r>   r0  rz  re   rC   r  )r   r   r0   rK   r:   rL   rN   r6  s      r   %test_set_context_session_with_capture0TestClient.test_set_context_session_with_captures  su    ] 56;;..|mW-ELG KKOOG$S.}=?TU ]]s   A0B
Bc                 $   [        5          [        S5        U R                  R                  SS5      u  pU R                  R	                  5         U R                  U5        U R                  US   S   S5        S S S 5        g ! , (       d  f       g = f)Nzpage-context-session-456r>   r  rC   r  )r   r   r0   rn  r:   rL   rN   r6  s      r   "test_set_context_session_with_page-TestClient.test_set_context_session_with_page  sm    ] :;;;++M;UVLGKKOOG$L!-02L ]]s   A-B
Bc                 @   [        5          [        S5        [        5       SS.nU R                  R	                  SSU5      u  p#U R                  R                  5         U R                  U5        U R                  US   S   S5        S S S 5        g ! , (       d  f       g = f)Nzpage-explicit-session-789landingr  r>   zhttps://example.com/landingrC   r  )r   r   r   r0   rn  r:   rL   rN   )r)   rC   rU   rV   s       r   6test_set_context_session_with_page_explicit_propertiesATestClient.test_set_context_session_with_page_explicit_properties  s    ] ;<  67&J  ;;++<jLG KKOOG$L!-02M ]]s   A;B
Bc                 0   SSK JnJn  U" 5          U" S5        U R                  R	                  SSSSS.5      u  p4U R                  R                  5         U R                  U5        U R                  US	   S
   S5        SSS5        g! , (       d  f       g= f)zETest that explicit session ID overrides context session ID in capturer   )r   r   zcontext-session-overrider>   r0  zexplicit-session-overridere   )r  rz  rC   r  N)posthog.scopesr   r   r0   rK   r:   rL   rN   )r)   r   r   rU   rV   s        r   ,test_set_context_session_override_in_capture7TestClient.test_set_context_session_override_in_capture  s}    C] :;;;.. ;GTLG
 KKOOG$L!-02M ]]s   A.B
Bc                 &   [        SS9   [        S5        U R                  R                  SSS05      u  pU R                  R	                  5         U R                  U5        U R                  US   S   S5        S S S 5        g ! , (       d  f       g = f)	NF)capture_exceptionszidentify-session-555r>   rd   re   rf   r  )r   r   r0   rg   r:   rL   rN   r6  s      r   &test_set_context_session_with_identify1TestClient.test_set_context_session_with_identify  sr    E2 67;;//?QRLGKKOOG$S[79OP 322s   A/B
B)r0   r(   )V__name__
__module____qualname____firstlineno__classmethodr   r#   r,   r2   r7   r;   rW   rZ   r^   rj   r}   r   r   r   r   r   r   r   r   r   r   r  r  r  r  r  r#  r-  r7  r;  r?  rC  rF  rK  rN  rX  r[  r_  rb  rg  ro  rr  ru  r   expandrP   r   r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r   r#  r+  r5  r>  ra  rr  ru  rx  r|  r  r  __static_attributes__r/  r   r   r   r      sh   * * ) )
H2<&EEC	<	<<<"4l
	P 
ZZ&'4 (44 
ZZ&'~@ (~@@ 
ZZ$%Q &Q$ 
ZZ&'h4 (h4T 
ZZ&'-
 (-
^ 
ZZ&'5
 (5
n 
ZZ&'4 (48C<*

<<&
<<&
<<&+(+*H2H6D	


<.   !3R<2"#1/4$9 $2/4$9 &s57|R<(,B?&B3,.CRL)	
0<10<.
&ND*  %.. $".#1VW* |, +#$>/3'5(*(, %?/3'5(*(,(   !$)$>/4'?)C(I/; %*$>/4'?)C(I/;Q?	
ADEEADE4  7 /6B#6" /!e4##!e4 )## ;!4G##!4G/	
 B<C B<,	.2!
"%&
&&6$3
3
* 
ZZ&'. (.4*"MSC 
ZZ&'-
 (-
^ 
ZZ'(	ZZ$%K & )K 
ZZ&'K
 (K
Z  G$5&	
(R33S(R33j 
ZZ&'3
 (3
j
V
$&	Qr   r   )r  unittestr   rB   r   r  r   r   r   r   r  r   rS  r
   posthog.requestr   posthog.test.test_utilsr   posthog.typesr   r   posthog.versionr   TestCaser   r/  r   r   <module>r     sE        S S  
 ' ! $ 5 9 #gQ"" gQr   