+
    TŎi>                        R t ^ RIt^ RIt^ RIHt ^ RIHt ^ RIHtH	t	H
t
 ^ RIHt ^ RIHt ^ RIHt ^ RIHt ^ R	IHt ^ R
IHt ^ RIHt ^ RIHt ^RI5 ^RI5  ! R R]4      t]R8X  d   ] PC                  4        R# R# )zz
Unit tests for the Python Facebook Business SDK.

How to run:
    python -m facebook_business.test.integration_adaccount
N)FacebookSession)FacebookRequestError)FacebookAdsApiFacebookRequestFacebookResponse)	AdAccount)
AdCreative)Ad)Campaign)AdsInsights)AgencyClientDeclaration)Business)ExtendedCreditInvoiceGroup)*c                   h   a  ] tR t^-t o R tR tR tR tR tR t	R t
R tR	 tR
 tR tR tRtV tR# )AdAccountTestCasec                t   \         P                  ! R R7      ;_uu_ 4       p\        P                  V P                  n        \        P                  R\        \        P                  4      ,           R,           \        \        P                  4      ,           R,           \        \        P                  4      ,           R,           \        \        P                  4      ,           R,           \        \        P                  4      ,           R,           \        \        P                  4      ,           R,           \        \        P                  4      ,           R,           \        \        P                  4      ,           R,           \        \        P                  4      ,           R,           \        \        P                  4      ,           R,           \        \        P                  4      ,           R,           \        \        P                  4      ,           R,           \        \        P                   4      ,           R,           \        \        P                   4      ,           R,           \        \        P"                  4      ,           R,           \        \        P"                  4      ,           R,           \        \        P$                  4      ,           R,           \        \        P$                  4      ,           R,           \        \        P&                  4      ,           R,           \        \        P&                  4      ,           R,           \        \        P(                  4      ,           R,           \        \        P(                  4      ,           R,           \        \        P*                  4      ,           R,           \        \        P*                  4      ,           R,           \        \        P,                  4      ,           R,           \        \        P,                  4      ,           R,           \        \        P.                  4      ,           R,           \        \        P.                  4      ,           R,           \        \        P0                  4      ,           R,           \        \        P0                  4      ,           R,           4      V P                  n        V P                  V P4                  n        \        P                  \        P                  \        P                  \        P                  \        P                  \        P                   \        P"                  \        P$                  \        P&                  \        P(                  \        P*                  \        P,                  \        P.                  \        P0                  .p/ p\9        \        P                  4      P;                  VVR7      pV P=                  \?        V4      ^ 4       V PA                  \C        V\8        4      4       V P=                  V\        P                  ,          \        P                  4       V P=                  V\        P                  ,          \        P                  4       V P=                  V\        P                  ,          \        P                  4       V PA                  \C        V\        P                  ,          \D        4      4       V P=                  V\        P                  ,          \        P                  4       V PA                  \C        V\        P                   ,          \F        4      4       V P=                  V\        P"                  ,          \        P"                  4       V P=                  V\        P$                  ,          \        P$                  .4       V P=                  V\        P&                  ,          \        P&                  4       V P=                  V\        P(                  ,          \        P(                  4       V PA                  \C        V\        P*                  ,          \H        4      4       V P=                  V\        P,                  ,          \J        PL                  ! \        P,                  4      .4       V P=                  V\        P.                  ,          \        P.                  4       V P=                  V\        P0                  ,          \J        PL                  ! \        P0                  4      4       R	R	R	4       R	#   + '       g   i     R	# ; i)
Trecord{"":"z","z":z,"}fieldsparamsN)'warningscatch_warnings
StatusCodeSUCCESSmock_responsestatus_codestrencode	FieldName
ACCOUNT_ID	TestValueACCOUNT_STATUSAGEAGENCY_CLIENT_DECLARATIONAMOUNT_SPENTBALANCEBUSINESSBUSINESS_CITYCAPABILITIESCURRENCYDISABLE_REASONEXTENDED_CREDIT_INVOICE_GROUPFAILED_DELIVERY_CHECKSHAS_PAGE_AUTHORIZED_ADACCOUNTTOS_ACCEPTED_contentmock_requestreturn_valuer   api_getassertEquallen
assertTrue
isinstancer   r   r   jsonloadsselfwarningr   r   accounts   &    {/Users/ahmad/.openclaw/workspace/scripts/.venv/lib/python3.14/site-packages/facebook_business/test/integration_adaccount.pytest_get_adaccount$AdAccountTestCase.test_get_adaccount.   s   $$D11W-7-?-?D**-**)../0278:=i>R>R:STW)22346:;=@AYAY=Z[^ )--() ,11 47y}}3EFI )==>	? BF	F ILILoLoHp	qt	
 )0012
 5::
 =@	@V@V<WX
[ )++,- 055 8;9;L;L7MNQ ),,-. 155 8;9;M;M7NOR )1123 6;; >AAXAX=YZ]	 )001	2 5:	: =@	@V@V<W	X[
 ),,-
. 16
6 9<I<N<N8O
PS )2234 7;; >AAYAY=Z[^ )AABC FJJ MPPYPwPwLxy| )::;< ?CC FIIiIiEjkn )AABC FKK NQQZQxQxMyz} )0012 599 <?y?U?U;VWZ+D'( .2-?-?D* $$((33!!""''&&""((770077&&F  F	 4 45== > G
 S\1-OOJw	:;WY%9%9:9;O;OPWY%=%=>	@X@XYWY]]3Y]]COOJwy/R/R'SUlmnWY%6%679J9JKOOJwy/A/A'BHMNWY%<%<=y?V?VWWY%;%;<y?U?U>VWWY%7%78):L:LMWY%=%=>	@X@XYOOJwy/V/V'WYstuWY%E%EFT]TtTtIuHvwWY%L%LMyOvOvwWY%;%;<djjI_I_>`a} 2111s   c<d&&d7	c           	     X   \         P                  ! R R7      ;_uu_ 4       p\        P                  V P                  n        V P                  V P                  n        R.p/ pV P                  \        4      ;_uu_ 4        \        \        P                  4      P                  VVR7      pRRR4       V P                  \        V4      ^4       V P!                  \#        V^ ,          P$                  \&        4      4       RRR4       R#   + '       g   i     Le; i  + '       g   i     R# ; iTr   unexist_fieldr   N)r   r   r   ERRORr   r    r5   r6   assertRaisesr   r   r%   r$   r7   r8   r9   r:   
issubclasscategoryUserWarningr>   s   &    rB   $test_get_adaccount_with_wrong_fields6AdAccountTestCase.test_get_adaccount_with_wrong_fieldsp   s    $$D11W-7-=-=D*-1-?-?D*  F F""#788#I$8$89AA!! B  9 S\1-OOJwqz':':KHI! 21 98 211%   AD=+D	(ADDDD)	c                2   \         P                  ! R R7      ;_uu_ 4       p\        P                  V P                  n        \        P                  R\        \        P                  4      ,           R,           \        \        P                  4      ,           R,           4      V P                  n        V P                  V P                  n        . p\        P                  \        P                  \        P                   \        P                   \        P"                  \        P"                  \        P$                  \        P$                  \        P&                  \        P&                  /p\)        \        P*                  4      P-                  VV4      pV P/                  \1        V4      ^ 4       V P3                  \5        V\6        4      4       V P/                  V\        P                  ,          \        P                  4       RRR4       R#   + '       g   i     R# ; i)Tr   r   r   z", "success": "true"}N)r   r   r   r   r   r    r!   r"   r#   IDr%   r$   r4   r5   r6   AD_ACCOUNT_CREATED_FROM_BM_FLAGr.   INVOICENAMETIMEZONE_IDr   BUSINESS_IDcreate_ad_accountr8   r9   r:   r;   r   r>   s   &    rB   test_create_adaccount'AdAccountTestCase.test_create_adaccount   sa   $$D11W-7-?-?D**-**TC	<M5MPU5UX[\e\p\pXq5q  uL  6L  +MD'-1-?-?D*F999;d;d""I$6$6!!9#4#4	%%y'<'<F y445GGG
 S\1-OOJw	:;WY\\2I4H4HI+ 2111s   GHH	c           	     \   \         P                  ! R R7      ;_uu_ 4       p\        P                  V P                  n        V P                  V P                  n        . pR^ RR/pV P                  \        4      ;_uu_ 4        \        \        P                  4      P                  VV4      pRRR4       V P                  \        V4      ^4       V P!                  \#        VR,          P$                  \&        4      4       RRR4       R#   + '       g   i     Le; i  + '       g   i     R# ; i)Tr   invoicetimezone_idabcN)r   r   r   rH   r   r    r5   r6   rI   r   r   r%   rV   rW   r8   r9   r:   rJ   rK   rL   r>   s   &    rB   'test_create_adaccount_with_wrong_params9AdAccountTestCase.test_create_adaccount_with_wrong_params   s    $$D11W-7-=-=D*-1-?-?D*F1uF ""#788"9#8#89KK 9 S\1-OOJwr{';';[IJ! 21 98 211s%   A D *D	*ADDDD+	c                   \         P                  ! R R7      ;_uu_ 4       p\        P                  V P                  n        \        P                  R\        \        P                  4      ,           R,           \        \        P                  4      ,           R,           4      V P                  n        V P                  V P                  n        \        P                  .p\        P                  \        P                  .\        P                   \        P                   .\        P"                  \        P"                  \        P$                  \        P$                  \        P&                  \        P&                  \        P(                  \        P(                  ./p\+        \        P                  4      P-                  VVR7      pV P/                  \1        V4      ^ 4       V P3                  \5        V^ ,          \6        4      4       V P/                  V^ ,          \        P                  ,          \        P                  4       RRR4       R#   + '       g   i     R# ; iTr   r   r   z"}r   N)r   r   r   r   r   r    r!   r"   r#   rQ   r%   r$   r4   r5   r6   ACTION_ATTRIBUTION_WINDOWSACTION_BREAKDOWNSACTION_REPORT_TIMEDATE_PRESETLEVELSUMMARY_ACTION_BREAKDOWNSr   get_insightsr8   r9   r:   r;   r   r?   r@   r   r   ad_insightss   &    rB   test_get_insights#AdAccountTestCase.test_get_insights   s   $$D11W-7-?-?D**-**),,'(*/025i6J6J2KLO+D' .2-?-?D* $$F 44y7[7[6\++i.I.I-J,,i.J.J%%y'<'<33i6Y6Y5ZF $I$8$89FF G K
 S\1-OOJ{1~{CD[^ILL99;O;OP; 2111s   HII	c           	        \         P                  ! R R7      ;_uu_ 4       p\        P                  V P                  n        V P                  V P                  n        R.p\        P                  R\        P                  R/pV P                  \        4      ;_uu_ 4        \        \        P                  4      P!                  VV4      pRRR4       V P#                  \%        V4      ^4       V P'                  \)        VR,          P*                  \,        4      4       RRR4       R#   + '       g   i     Le; i  + '       g   i     R# ; i)Tr   unexisted_fieldinvalide_datewrong_levelNr^   )r   r   r   rH   r   r    r5   r6   r#   rf   rg   rI   r   r   r%   r$   ri   r8   r9   r:   rJ   rK   rL   rj   s   &    rB   .test_get_insights_with_wrong_fields_and_params@AdAccountTestCase.test_get_insights_with_wrong_fields_and_params   s    $$D11W-7-=-=D*-1-?-?D* "F %%F ""#788'	(<(<=JJ 9 S\1-OOJwr{';';[IJ% 21 98 211s%   A=D7*D$	AD7$D4/D77E	c                B   \         P                  ! R R7      ;_uu_ 4       p\        P                  V P                  n        \        P                  R\        \        P                  4      ,           R,           \        \        P                  4      ,           R,           4      V P                  n        V P                  V P                  n        \        P                  .p/ p\        \        P                  4      P!                  VVR7      pV P#                  \%        V4      ^ 4       V P'                  \)        V^ ,          \*        4      4       V P#                  V^ ,          \        P                  ,          \        P                  4       RRR4       R#   + '       g   i     R# ; irb   )r   r   r   r   r   r    r!   r"   r#   rT   r%   r4   r5   r6   r   r$   get_ad_creativesr8   r9   r:   r;   r   r?   r@   r   r   	creativess   &    rB   test_get_ad_creatives'AdAccountTestCase.test_get_ad_creatives   s,   $$D11W-7-?-?D**-**)..)*,1247	4GHK+D' .2-?-?D* F F!)"6"67HH I I
 S\1-OOJy|Z@AYq\)..99>>J- 2111s   E#FF	c           	     X   \         P                  ! R R7      ;_uu_ 4       p\        P                  V P                  n        V P                  V P                  n        R.p/ pV P                  \        4      ;_uu_ 4        \        \        P                  4      P                  VVR7      pRRR4       V P                  \        V4      ^4       V P!                  \#        V^ ,          P$                  \&        4      4       RRR4       R#   + '       g   i     Le; i  + '       g   i     R# ; irF   )r   r   r   rH   r   r    r5   r6   rI   r   r   r%   r$   ru   r8   r9   r:   rJ   rK   rL   rv   s   &    rB   'test_get_ad_creatives_with_wrong_fields9AdAccountTestCase.test_get_ad_creatives_with_wrong_fields  s    $$D11W-7-=-=D*-1-?-?D*  F F""#788%i&:&:;LL!! M 	 9 S\1-OOJwqz':':KHI 21 98 211rO   c                \   \         P                  ! R R7      ;_uu_ 4       p\        P                  V P                  n        \        P                  R\        \        P                  4      ,           R,           \        \        P                  4      ,           R,           4      V P                  n        V P                  V P                  n        \        P                  .p\        P                  \        P                  \        P                  \        P                  .\        P                   \        P                   \        P"                  \$        P&                  ! \        P"                  4      /p\)        \        P*                  4      P-                  VVR7      pV P/                  \1        V4      ^ 4       V P3                  \5        V^ ,          \6        4      4       V P/                  V^ ,          \        P                  ,          \        P                  4       RRR4       R#   + '       g   i     R# ; irb   )r   r   r   r   r   r    r!   r"   r#   rT   r%   r4   r5   r6   rf   EFFECTIVE_STATUSINCLUDE_DRAFTS
TIME_RANGEr<   r=   r   r$   get_campaignsr8   r9   r:   r;   r
   r?   r@   r   r   	campaignss   &    rB   test_get_campaigns$AdAccountTestCase.test_get_campaigns  s   $$D11W-7-?-?D**-**)..)*,1247	4GHK+D' .2-?-?D* F %%y'<'<**Y-G-G,H(()*B*B$$djj1E1E&F	F ")"6"67EE F I
 S\1-OOJy|X>?Yq\)..99>>J7 2111s   G0HH+	c           	     x   \         P                  ! R R7      ;_uu_ 4       p\        P                  V P                  n        V P                  V P                  n        R.p\        P                  R/pV P                  \        4      ;_uu_ 4        \        \        P                  4      P                  VVR7      pRRR4       V P!                  \#        V4      ^4       V P%                  \'        V^ ,          P(                  \*        4      4       RRR4       R#   + '       g   i     Le; i  + '       g   i     R# ; iTr   rG   unexisted_statusr   N)r   r   r   rH   r   r    r5   r6   r#   r~   rI   r   r   r%   r$   r   r8   r9   r:   rJ   rK   rL   r   s   &    rB   /test_get_campaigns_with_wrong_fields_and_paramsAAdAccountTestCase.test_get_campaigns_with_wrong_fields_and_params5  s    $$D11W-7-=-=D*-1-?-?D*  F **,>F ""#788%i&:&:;II!! J 	 9 S\1-OOJwqz':':KHI% 21 98 211%   A-D(+D	8AD(D% D((D9	c                   \         P                  ! R R7      ;_uu_ 4       p\        P                  V P                  n        \        P                  R\        \        P                  4      ,           R,           \        \        P                  4      ,           R,           4      V P                  n        V P                  V P                  n        \        P                  .p\        P                  \        P                  \        P                  \        P                  .\        P                   \        P                   \        P"                  \$        P&                  ! \        P"                  4      \        P(                  \        P(                  /p\+        \        P,                  4      P/                  VVR7      pV P1                  \3        V4      ^ 4       V P5                  \7        V^ ,          \8        4      4       V P1                  V^ ,          \        P                  ,          \        P                  4       RRR4       R#   + '       g   i     R# ; irb   )r   r   r   r   r   r    r!   r"   r#   rT   r%   r4   r5   r6   rf   r~   r   r   r<   r=   UPDATED_SINCEr   r$   get_adsr8   r9   r:   r;   r	   r?   r@   r   r   adss   &    rB   test_get_adsAdAccountTestCase.test_get_adsK  s   $$D11W-7-?-?D**-**)..)*,1247	4GHK+D' .2-?-?D* F %%y'<'<**Y-G-G,H(()*B*B$$djj1E1E&F'')@)@F I00199 : C
 S\1-OOJs1vr23SVINN3Y^^D9 2111s   HH88I		c           	     x   \         P                  ! R R7      ;_uu_ 4       p\        P                  V P                  n        V P                  V P                  n        R.p\        P                  R/pV P                  \        4      ;_uu_ 4        \        \        P                  4      P                  VVR7      pRRR4       V P!                  \#        V4      ^4       V P%                  \'        V^ ,          P(                  \*        4      4       RRR4       R#   + '       g   i     Le; i  + '       g   i     R# ; ir   )r   r   r   rH   r   r    r5   r6   r#   r~   rI   r   r   r%   r$   r   r8   r9   r:   rJ   rK   rL   r   s   &    rB   (test_get_ads_with_wrong_fields_and_param:AdAccountTestCase.test_get_ads_with_wrong_fields_and_paramk  s    $$D11W-7-=-=D*-1-?-?D*  F **,>F ""#788	 4 45==!! >  9 S\1-OOJwqz':':KHI# 21 98 211r    N)__name__
__module____qualname____firstlineno__rC   rM   rX   r_   rl   rr   rx   r{   r   r   r   r   __static_attributes____classdictcell__)__classdict__s   @rB   r   r   -   sV     ?bDJ(J2K(QDK,K4J&K>J,E@J J    r   __main__)"__doc__r   r<   facebook_business.sessionr   facebook_business.exceptionsr   facebook_business.apir   r   r   %facebook_business.adobjects.adaccountr   &facebook_business.adobjects.adcreativer   facebook_business.adobjects.adr	   $facebook_business.adobjects.campaignr
   'facebook_business.adobjects.adsinsightsr   3facebook_business.adobjects.agencyclientdeclarationr   $facebook_business.adobjects.businessr   6facebook_business.adobjects.extendedcreditinvoicegroupr   integration_utilsintegration_constantIntegrationTestCaser   r   unittestmainr   r   rB   <module>r      sf   *   5 = S S ; = - 9 ? W 9 ]   #PJ+ PJf
 zMMO r   