+
    TŎig0                         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5 ^R
I5  ! R R]4      t]R8X  d   ]P7                  4        R# R# )zs
Unit tests for the Python Facebook Business SDK.

How to run:
    python -m facebook_business.test.integration_ad
N)FacebookSession)FacebookRequestError)FacebookAdsApiFacebookRequestFacebookResponse)	AdAccount)
AdCreative)Ad)	Targeting)AdsInsights)*c                   P   a  ] tR t^+t o R tR tR tR tR tR t	R t
R tR	tV tR
# )
AdTestCasec                   \         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,           4      V P                  n        V P                  V P2                  n        \        P                  \        P                  \        P                  \        P                  \        P                  \        P                   \        P"                  \        P$                  \        P&                  \        P(                  \        P*                  \        P,                  \        P.                  .p/ p\7        \        P8                  4      P;                  VVR7      pV P=                  \?        V4      ^ 4       V PA                  \C        V\6        4      4       V P=                  V\        P                  ,          \        P                  4       V P=                  V\        P                  ,          \D        PF                  ! \        P                  4      4       V P=                  V\        P                  ,          \D        PF                  ! \        P                  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"                  ,          \H        4      4       V P=                  V\        P$                  ,          \        P$                  4       V P=                  V\        P&                  ,          \D        PF                  ! \        P&                  4      .4       V P=                  V\        P(                  ,          \        P(                  4       V PA                  \C        V\        P*                  ,          \J        4      4       V P=                  V\        P,                  ,          \        P,                  4       V P=                  V\        P.                  ,          \        P.                  .4       R	R	R	4       R	#   + '       g   i     R	# ; i)
Trecord{"":"","z":z,""}fieldsparamsN)&warningscatch_warnings
StatusCodeSUCCESSmock_responsestatus_codestrencode	FieldName
ACCOUNT_ID	TestValueAD_REVIEW_FEEDBACKADLABELSAD_LABELADSET_ID
BID_AMOUNTCONFIGURED_STATUSCREATIVEEFFECTIVE_STATUSISSUES_INFOPRIORITY	TARGETINGDATE_FORMATEXECUTION_OPTIONS_contentmock_requestreturn_valuer	   AD_IDapi_getassertEquallen
assertTrue
isinstancejsonloadsr   r
   selfwarningr   r   ads   &    t/Users/ahmad/.openclaw/workspace/scripts/.venv/lib/python3.14/site-packages/facebook_business/test/integration_ad.pytest_get_adAdTestCase.test_get_ad,   sB   $$D11W-7-?-?D**-**)../0278:=i>R>R:STW)6678:>?ADYEaEaAbcf ),,-. 155 8;9;M;M7NOR ),,-	. 16	6 9<I<N<N8O	PS	
 )../0
 388
 ;>i>R>R:ST
W )5567 :?? BEYE`E`Aabe ),,-. 155 8;9;M;M7NOR )4456 9>> ADID^D^@_`c	 )//0	1 48	8 ;>i>S>S:T	UX
 ),,-
. 16
6 9<I<N<N8O
PS )--./ 266 9<I<O<O8PQT )//01 499 <?y?T?T;UVY )5567 :?? BEYE`E`Aabe+D'$ .2-?-?D* $$,,""""$$++""**%%""##%%++F FIOO$,, - B
 S\1-OOJr2./R	 4 45y7K7KLR	 < <=tzz)JfJf?ghR	 2 23djjASAS6T5UVR	 2 23Y5G5GHR	 4 45y7K7KLR	 ; ;<i>Y>YZOOJr)*<*<'=zJKR	 : :;Y=W=WXR	 5 56IDYDY9Z8[\R	 2 23Y5G5GHOOJr)*=*='>	JKR	 5 56	8M8MNR	 ; ;<y?Z?Z>[\u 2111s   `:a$$a5	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   r2   r3   assertRaisesr   r	   r#   r4   r5   r6   r7   r8   
issubclasscategoryUserWarningr<   s   &    r@   test_get_ad_with_wrong_fields(AdTestCase.test_get_ad_with_wrong_fieldsj   s    $$D11W-7-=-=D*-1-?-?D*  F F""#788	(00!! 1  9 S\1-OOJwqz':':KHI 21 98 211%   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                   4      \        P&                  \"        P$                  ! \        P(                  4      .\        P*                  \        P*                  \        P,                  \        P,                  \        P.                  \        P.                  \        P0                  \"        P$                  ! \        P0                  4      \        P2                  \        P2                  \        P4                  \"        P$                  ! \        P4                  4      .\        P6                  \        P6                  \        P8                  \"        P$                  ! \        P8                  4      \        P:                  \        P:                  \        P<                  \        P<                  ./p\?        \        P                  4      PA                  VV4      pV PC                  \E        V4      ^ 4       V PG                  \I        V\J        4      4       V PC                  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#   r4   r1   r2   r3   r"   r$   r:   r;   r%   r&   r'   r(   r)   r*   r+   r,   r-   r.   r/   r0   r   	create_adr6   r7   r8   r9   r	   r<   s   &    r@   test_create_adAdTestCase.test_create_ad}   s!   $$D11W-7-?-?D**-**TC	<M5MPU5UX[\e\k\kXl5l  pG  6G  +HD'-1-?-?D*F$$i&:&:,,djj9U9U.V""TZZ	0B0B%C$D""I$6$6$$i&:&:++Y-H-H""DJJy/A/A$B**I,F,F%%

93H3H(I'J""I$6$6##TZZ	0C0C%D%%y'<'<++i.I.I-JF  9//0::B
 S\1-OOJr2./R	-y?; 2111s   L2MM-	c           	     \   \         P                  ! R R7      ;_uu_ 4       p\        P                  V P                  n        V P                  V P                  n        . pR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^ ,          P$                  \&        4      4       RRR4       R#   + '       g   i     Le; i  + '       g   i     R# ; i)Tr   statusunexited_statuspriorityhightN)r   r   r   rF   r   r   r2   r3   rG   r   r   r#   r"   rP   r6   r7   r8   rH   rI   rJ   r<   s   &    r@    test_create_ad_with_wrong_params+AdTestCase.test_create_ad_with_wrong_params   s    $$D11W-7-=-=D*-1-?-?D*F+GF ""#788y334>> 9 S\1-OOJwqz':':KHI! 21 98 211s%   A D *D	*ADDDD+	c                l   \         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,           4      V P                  n        V P                  V P                  n        \        P                  \        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       V P'                  V^ ,          \        P                  ,          \        P                  4       RRR4       R#   + '       g   i     R# ; iTr   r   r   r   r   r   N)r   r   r   r   r   r   r   r    r!   NAMEr#   rO   CREATIVE_IDr1   r2   r3   r	   r4   get_ad_creativesr6   r7   r8   r9   r   r=   r>   r   r   	creativess   &    r@   test_get_ad_creatives AdTestCase.test_get_ad_creatives   s   $$D11W-7-?-?D**-**)..)*,1247	4GHK),,'(*/025i6K6K2LMP+D' .2-?-?D* F F9??+<< = I
 S\1-OOJy|Z@AYq\)..99>>JYq\),,79N9NO3 2111s   G8H""H3	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rD   )r   r   r   rF   r   r   r2   r3   rG   r   r	   r#   r4   r^   r6   r7   r8   rH   rI   rJ   r_   s   &    r@   'test_get_ad_creatives_with_wrong_fields2AdTestCase.test_get_ad_creatives_with_wrong_fields   s    $$D11W-7-=-=D*-1-?-?D*  F F""#788y/@@!! A 	 9 S\1-OOJwqz':':KHI 21 98 211rM   c                    \         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,           4      V P                  n        V P                  V P                   n        \        P                  .p\        P$                  \        P$                  .\        P&                  \        P&                  .\        P(                  \        P(                  \        P*                  \        P*                  \        P,                  \        P,                  ./p\/        \        P                  4      P1                  VVR7      pV P3                  \5        V4      ^ 4       V P7                  \9        V^ ,          \:        4      4       V P3                  V^ ,          \        P                  ,          \        P                  4       V P3                  V^ ,          \        P                  ,          \        P                  4       V P3                  V^ ,          \        P                  ,          \        P                  4       RRR4       R#   + '       g   i     R# ; ir[   )r   r   r   r   r   r   r   r    r!   AD_NAMEr#   r\   r4   
DATE_START	DATE_STOPr1   r2   r3   ACTION_BREAKDOWNSACTION_ATTRIBUTION_WINDOWSDATE_PRESETLEVELSUMMARY_ACTION_BREAKDOWNSr	   get_insightsr6   r7   r8   r9   r   r=   r>   r   r   ad_insightss   &    r@   test_get_insightsAdTestCase.test_get_insights   s   $$D11W-7-?-?D**-**)++,-/457:9>>7JKN)//*+-23585IJM )../0 388 ;>i>R>R:STW )--.	/ 27	7 :=Y=P=P9Q	RU	+D' .2-?-?D* !!F ++i.I.I-J44y7[7[6\%%y'<'<33i6Y6Y5ZF Y__-:: ; K
 S\1-OOJ{1~{CD[^I,=,=>	O[^I,@,@A9CWCWX[^I,?,?@)BUBUVC 2111s   MM<<N	c           	        \         P                  ! R R7      ;_uu_ 4       p\        P                  V P                  n        V P                  V P                  n        R.p\        P                  ^\        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^ ,          P*                  \,        4      4       RRR4       R#   + '       g   i     Le; i  + '       g   i     R# ; i)Tr   unexisted_fieldswrong_levelN)r   r   r   rF   r   r   r2   r3   r!   rj   rm   rG   r   r	   r#   r4   ro   r6   r7   r8   rH   rI   rJ   rp   s   &    r@   .test_get_insights_with_wrong_fields_and_params9AdTestCase.test_get_insights_with_wrong_fields_and_params  s    $$D11W-7-=-=D*-1-?-?D* #F ++QF ""#788 1>> 9 S\1-OOJwqz':':KHI% 21 98 211s%   A=D7*D$	AD7$D4/D77E	 N)__name__
__module____qualname____firstlineno__rA   rK   rQ   rX   ra   rd   rr   rw   __static_attributes____classdictcell__)__classdict__s   @r@   r   r   +   s>     ;]|J&@BJ(P:J&"WJ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.targetingr
   'facebook_business.adobjects.adsinsightsr   integration_utilsintegration_constantIntegrationTestCaser   rz   unittestmainry   r   r@   <module>r      s]   *   5 = S S ; = - ; ?   #oJ$ oJd zMMO r   