+
    )Yje                         ^ RI t ^ RIt^ RIt^ RIt^ RIHt ^ RIHt ^ RIH	t	 ^ RI
tRtRtRtRtR	 t ! R
 R]P"                  4      t]R8X  d   ]P(                  ! 4        R# R# )    N)	Namespace)Path)patcha  
<html><body>
  <a href="/shop/product/G16K3LL/A/refurbished-mac-mini">
    <h3>Refurbished Mac mini Apple M4 Chip with 10-Core CPU and 10-Core GPU, Gigabit Ethernet</h3>
    <span class="price-point">$509.00</span>
  </a>
  <a href="/shop/product/G1ABC/refurbished-13-inch-macbook-air">
    <h3>Refurbished 13-inch MacBook Air Apple M4 chip with 10-Core CPU and 8-Core GPU - Sky Blue</h3>
    <span class="price-point">Now $849.00</span>
  </a>
  <a href="/shop/product/G1DEF/refurbished-15-inch-macbook-air">
    <h3>Refurbished 15-inch MacBook Air Apple M4 chip with 10-Core CPU and 10-Core GPU - Silver</h3>
    <span class="price-point">$929.00</span>
  </a>
  <a href="/shop/product/G2STUDIO/refurbished-mac-studio">
    <h3>Refurbished Mac Studio Apple M2 Max Chip with 12-Core CPU and 30-Core GPU, 64GB unified memory, 1TB SSD</h3>
    <span class="price-point">$1,999.00</span>
  </a>
</body></html>
a:  
<script type="application/json">
{"tiles":[
  {"productDetailsUrl":"/shop/product/g1aaa/a/Refurbished-Mac-mini-Apple-M4-Chip-with-10-Core-CPU-and-10-Core-GPU",
   "partNumber":"G1AAA/A",
   "title":"Refurbished Mac mini Apple M4 Chip with 10-Core CPU and 10-Core GPU, Gigabit Ethernet",
   "price":{"currentPrice":{"raw_amount":"679.00"}},
   "filters":{"dimensions":{"dimensionCapacity":"512gb","tsMemorySize":"16gb"}}},
  {"productDetailsUrl":"/shop/product/g1bbb/a/Refurbished-13-inch-MacBook-Air",
   "partNumber":"G1BBB/A",
   "title":"Refurbished 13-inch MacBook Air Apple M4 chip with 10-Core CPU and 8-Core GPU - Midnight",
   "price":{"currentPrice":{"amount":"<span class=\"visuallyhidden\">Now</span>$849.00"}},
   "filters":{"dimensions":{"dimensionCapacity":"256gb","tsMemorySize":"16gb"}}},
  {"partNumber":"G1CCC/A",
   "title":"Refurbished 15-inch MacBook Air Apple M4 chip with 10-Core CPU and 10-Core GPU - Silver",
   "price":{"currentPrice":{"raw_amount":"929.00"}},
   "filters":{"dimensions":{"dimensionCapacity":"256gb","tsMemorySize":"16gb"}}}
]}
</script>
a  
<script type="application/json">
{"tiles":[
  {"productDetailsUrl":"/shop/product/g4eee/a/Refurbished-Mac-mini-24gb-512gb",
   "partNumber":"G4EEE/A",
   "title":"Refurbished Mac mini Apple M4 Chip with 10-Core CPU and 10-Core GPU",
   "price":{"currentPrice":{"raw_amount":"799.00"}},
   "filters":{"dimensions":{"dimensionCapacity":"512gb","tsMemorySize":"24gb"}}},
  {"productDetailsUrl":"/shop/product/g4aaa/a/Refurbished-Mac-mini-32gb-512gb",
   "partNumber":"G4AAA/A",
   "title":"Refurbished Mac mini Apple M4 Chip with 10-Core CPU and 10-Core GPU",
   "price":{"currentPrice":{"raw_amount":"899.00"}},
   "filters":{"dimensions":{"dimensionCapacity":"512gb","tsMemorySize":"32gb"}}},
  {"productDetailsUrl":"/shop/product/g4bbb/a/Refurbished-Mac-mini-32gb-1tb",
   "partNumber":"G4BBB/A",
   "title":"Refurbished Mac mini Apple M4 Chip with 10-Core CPU and 10-Core GPU",
   "price":{"currentPrice":{"raw_amount":"999.00"}},
   "filters":{"dimensions":{"dimensionCapacity":"1tb","tsMemorySize":"32gb"}}},
  {"productDetailsUrl":"/shop/product/g4ccc/a/Refurbished-Mac-mini-16gb-512gb",
   "partNumber":"G4CCC/A",
   "title":"Refurbished Mac mini Apple M4 Chip with 10-Core CPU and 10-Core GPU",
   "price":{"currentPrice":{"raw_amount":"679.00"}},
   "filters":{"dimensions":{"dimensionCapacity":"512gb","tsMemorySize":"16gb"}}},
  {"productDetailsUrl":"/shop/product/g4ddd/a/Refurbished-Mac-mini-32gb-256gb",
   "partNumber":"G4DDD/A",
   "title":"Refurbished Mac mini Apple M4 Chip with 10-Core CPU and 10-Core GPU",
   "price":{"currentPrice":{"raw_amount":"799.00"}},
   "filters":{"dimensions":{"dimensionCapacity":"256gb","tsMemorySize":"32gb"}}}
]}
</script>
a	  
<script type="application/json">
{"tiles":[
  {"productDetailsUrl":"/shop/product/g2aaa/a/Refurbished-Mac-Studio-Apple-M2-Ultra",
   "partNumber":"G2AAA/A",
   "title":"Refurbished Mac Studio Apple M2 Ultra Chip with 24-Core CPU and 60-Core GPU",
   "price":{"currentPrice":{"raw_amount":"3999.00"}},
   "filters":{"dimensions":{"dimensionCapacity":"1tb","tsMemorySize":"96gb"}}},
  {"productDetailsUrl":"/shop/product/g2bbb/a/Refurbished-Mac-Studio-Apple-M2-Ultra",
   "partNumber":"G2BBB/A",
   "title":"Refurbished Mac Studio Apple M2 Ultra Chip with 24-Core CPU and 76-Core GPU",
   "price":{"currentPrice":{"raw_amount":"4799.00"}},
   "filters":{"dimensions":{"dimensionCapacity":"2tb","tsMemorySize":"128gb"}}},
  {"productDetailsUrl":"/shop/product/g2ccc/a/Refurbished-Mac-Studio-Apple-M2-Max",
   "partNumber":"G2CCC/A",
   "title":"Refurbished Mac Studio Apple M2 Max Chip with 12-Core CPU and 30-Core GPU",
   "price":{"currentPrice":{"raw_amount":"1699.00"}},
   "filters":{"dimensions":{"dimensionCapacity":"512gb","tsMemorySize":"32gb"}}},
  {"productDetailsUrl":"/shop/product/g3aaa/a/Refurbished-14-inch-MacBook-Pro-Apple-M5",
   "partNumber":"G3AAA/A",
   "title":"Refurbished 14-inch MacBook Pro Apple M5 Pro Chip with 12-Core CPU and 16-Core GPU - Space Black",
   "price":{"currentPrice":{"raw_amount":"2499.00"}},
   "filters":{"dimensions":{"dimensionCapacity":"1tb","tsMemorySize":"64gb"}}},
  {"productDetailsUrl":"/shop/product/g3bbb/a/Refurbished-16-inch-MacBook-Pro-Apple-M5",
   "partNumber":"G3BBB/A",
   "title":"Refurbished 16-inch MacBook Pro Apple M5 Max Chip with 16-Core CPU and 40-Core GPU - Silver",
   "price":{"currentPrice":{"raw_amount":"3499.00"}},
   "filters":{"dimensions":{"dimensionCapacity":"1tb","tsMemorySize":"96gb"}}},
  {"productDetailsUrl":"/shop/product/g3ccc/a/Refurbished-14-inch-MacBook-Pro-Apple-M5",
   "partNumber":"G3CCC/A",
   "title":"Refurbished 14-inch MacBook Pro Apple M5 Pro Chip with 12-Core CPU and 16-Core GPU - Silver",
   "price":{"currentPrice":{"raw_amount":"1999.00"}},
   "filters":{"dimensions":{"dimensionCapacity":"512gb","tsMemorySize":"48gb"}}},
  {"productDetailsUrl":"/shop/product/g3ddd/a/Refurbished-14-inch-MacBook-Pro-Apple-M4",
   "partNumber":"G3DDD/A",
   "title":"Refurbished 14-inch MacBook Pro Apple M4 Max Chip with 14-Core CPU and 32-Core GPU - Space Black",
   "price":{"currentPrice":{"raw_amount":"2899.00"}},
   "filters":{"dimensions":{"dimensionCapacity":"1tb","tsMemorySize":"64gb"}}}
]}
</script>
c                 x    Vf#   \         P                  P                  V R 4       R # V\         P                  V &   R # N)osenvironpop)keyvalues   &&X/Users/jameslopez/projects/FindRefurbishedAppleProduct/tests/test_refurbished_watcher.pyrestore_envr      s&    }


sD!

3    c                      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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# )RefurbishedWatcherTestsc                    \         P                  ! \        \         P                  4      pT P	                  V Uu. uF  q"P
                  NK  	  upR .4       V P	                  V^ ,          P                  R4       R# u upi )G2STUDIOz	$1,999.00N)watcherparse_listingLISTING_HTMLDEFAULT_URLassertEqualr   priceselfproductsproducts   &  r   -test_parse_listing_filters_targets_and_pricesERefurbishedWatcherTests.test_parse_listing_filters_targets_and_prices   s\    ((w7J7JKX>X'++X>M!**K8 ?s   A;c                |    \         P                  ! \        \         P                  4      pV P	                  V. 4       R # r   )r   r   EMBEDDED_LISTING_HTMLr   r   r   r   s   & r   5test_parse_embedded_tiles_ignores_non_studio_productsMRefurbishedWatcherTests.test_parse_embedded_tiles_ignores_non_studio_products   s+    (()>@S@ST2&r   c                H   \         P                  ! \        \         P                  4      pT P	                  V Uu. uF  q"P
                  NK  	  upR R.4       V P	                  V^ ,          P                  R4       V P	                  V^,          P                  R4       R# u upi )G2AAA/AzG2BBB/A96GB128GBN)r   r   HIGH_MEMORY_LISTING_HTMLr   r   r   ramr   s   &  r   >test_parse_embedded_tiles_matches_high_memory_mac_studios_onlyVRefurbishedWatcherTests.test_parse_embedded_tiles_matches_high_memory_mac_studios_only   sv    (()A7CVCVWX>X'++X>I@VW!&1!'2 ?s   Bc                   \         P                  ! R RRRR7      p\        P                  ! \         R\         P                  ! R/ / VP                  CRRRR	/CB R
7      ;_uu_ 4        \         P
                  ! V.\         P                  ^R7      pRRR4       T P                  X Uu. uF  q3P                  NK  	  upR .4       R#   + '       g   i     L>; iu upi )G2TARGETz*Refurbished Mac Studio Apple M2 Ultra Chipz	$3,999.00zBhttps://www.apple.com/shop/product/G2TARGET/refurbished-mac-studio)r   titler   urlenrich_productr*   r'   storage1TBreturn_value)timeoutN )	r   Productr   object__dict__filter_targetsDEFAULT_CRITERIAr   r   )r   r   r   items   &   r   8test_filter_targets_enriches_candidates_with_missing_ramPRefurbishedWatcherTests.test_filter_targets_enriches_candidates_with_missing_ram   s    //>T	
 \\'#3'//  CK  UJW^WgWg  UJinpv  yB  DI  UJ  CK  L  L--wi9Q9Q[\]H L 	x8xt((x8:,G L  L 9s   &)C&CC	c                |    \         P                  ! \        \         P                  4      pV P	                  V. 4       R # r   )r   r   MAC_MINI_CRITERIA_HTMLr   r   r"   s   & r   test_mac_mini_does_not_match4RefurbishedWatcherTests.test_mac_mini_does_not_match   s+    (()?ATATU2&r   c                    R pV P                  \        P                  ! V4      R4       V P                  \        P                  ! V4      R4       R# )zEConfigurable specs include 24GB unified memory and 512GB SSD storage.24GB512GBN)r   r   extract_ramextract_storage)r   texts   & r   test_extract_details,RefurbishedWatcherTests.test_extract_details   s=    V,,T2F;006@r   c                V    R pV P                  \        P                  ! V4      R4       R# )zShttps://www.apple.com/shop/product/g2aaa/a/refurbished-mac-studio?fnode=abc#sectionzAhttps://www.apple.com/shop/product/g2aaa/a/refurbished-mac-studioN)r   r   canonical_product_url)r   r0   s   & r   1test_canonical_product_url_removes_volatile_queryIRefurbishedWatcherTests.test_canonical_product_url_removes_volatile_query   s&    c))#.O	
r   c                   \         P                  ! 4       ;_uu_ 4       p\        V4      R ,          p\        \        P
                  \        V4      \        \        V4      R,          4      \        \        V4      R,          4      ^\        P                  \        P                  ^ RRRRRRR7      p\        P                  ! \        R\        R7      ;_uu_ 4        \        P                  ! \        R	4      ;_uu_ 4       p\        P                  ! V4      pR
R
R
4       R
R
R
4       V P                  X. 4       XP                  4        \        P                   ! VP#                  4       4      pV P                  VR,          R.4       R
R
R
4       R
#   + '       g   i     L; i  + '       g   i     L; i  + '       g   i     R
# ; i)
state.jsoninventory.jsonlinventory-state.jsonFhttps://ntfy.shrefurbishedMacr0   
state_fileinventory_history_fileinventory_state_filer6   target_title_contains
min_ram_gbmax_productsnotify_on_first_rundry_run	no_notifyadd_to_cartntfy_servertopic
fetch_textr4   notify_ntfyN	seen_keysr   )tempfileTemporaryDirectoryr   r   r   r   strDEFAULT_TARGET_TITLE_CONTAINSMAC_STUDIO_MIN_RAM_GBr   r9   r   
check_oncer   assert_not_calledjsonloads	read_text)r   tmpdirrW   argsnotifynew_productsstates   &      r   .test_first_run_baselines_without_notificationsFRefurbishedWatcherTests.test_first_run_baselines_without_notifications   sB   ((**ff4J''z?'*4<:K+K'L%(f8N)N%O&-&K&K"88$)!-&D" g|,OOQVQ]Q]^egtQuQuy&11$7 RvO \2.$$&JJz3356EU;/*>3 +*& RvQuOO' +**s=   B:F3$F 	<FF 	A(F3FF 	 F0+F33G	c                   \         P                  ! 4       ;_uu_ 4       p\        V4      R ,          pVP                  \        P
                  ! RR./4      4       \        \        P                  \        V4      \        \        V4      R,          4      \        \        V4      R,          4      ^\        P                  \        P                  ^ RRRRRRR7      p\        P                  ! \        R	\        R
7      ;_uu_ 4        \        P                  ! \        RRR lR7      ;_uu_ 4        \        P                  ! \        R4      ;_uu_ 4       p\        P                  ! V4      pRRR4       RRR4       RRR4       T P!                  X Uu. uF  qfP"                  NK  	  upR.4       XP%                  4        \        P&                  ! VP)                  4       4      pV P!                  VR,          R.4       RRR4       R#   + '       g   i     L; i  + '       g   i     L; i  + '       g   i     L; iu upi   + '       g   i     R# ; i)rQ   re   OLDMATCHrR   rS   FrT   rU   rV   rc   r4   r1   c                     V # r   r7   r   r6   s   &&r   <lambda>XRefurbishedWatcherTests.test_new_product_after_previous_check_notifies.<locals>.<lambda>       _fr   side_effectrd   Nr      )rf   rg   r   
write_textrm   dumpsr   r   r   rh   ri   rj   r   r9   r   rk   r   r   assert_called_oncern   ro   )r   rp   rW   rq   rr   rs   r   rt   s   &       r   .test_new_product_after_previous_check_notifiesFRefurbishedWatcherTests.test_new_product_after_previous_check_notifies   s   ((**ff4J!!$**kJ<-H"IJ''z?'*4<:K+K'L%(f8N)N%O&-&K&K"88$)!-&D$ WlNNW&6DfggWm44&11$7 5 h O FgkkFU%%'JJz3356EU;/*>= +*. 54 hg ON G7 +**sa   C"H> )H&	)$HH $H,H&	4H>H9AH> HHH#H&	&H61H>>I	c                &   \         P                  ! 4       ;_uu_ 4       p\        V4      R ,          pVP                  \        P
                  ! R. /4      4       \        \        P                  \        V4      \        \        V4      R,          4      \        \        V4      R,          4      ^\        P                  \        P                  ^ RRRRRRR7      p\        P                  ! \        R\        R	7      ;_uu_ 4        \        P                  ! \        R
RR lR7      ;_uu_ 4        \        P                  ! \        R4      ;_uu_ 4       p\        P                  ! V4      pRRR4       RRR4       RRR4       T P!                  X Uu. uF  qfP"                  NK  	  upR.4       XP%                  4        RRR4       R#   + '       g   i     Lf; i  + '       g   i     Lq; i  + '       g   i     L|; iu upi   + '       g   i     R# ; i)rQ   re   rR   rS   FrT   rU   rV   rc   r4   r1   c                     V # r   r7   rz   s   &&r   r{   XRefurbishedWatcherTests.test_new_product_after_empty_baseline_notifies.<locals>.<lambda>  r}   r   r~   rd   Nr   r   rf   rg   r   r   rm   r   r   r   r   rh   ri   rj   r   r9   r   rk   r   r   r   r   rp   rW   rq   rr   rs   r   s   &      r   .test_new_product_after_empty_baseline_notifiesFRefurbishedWatcherTests.test_new_product_after_empty_baseline_notifies   sj   ((**ff4J!!$**k2->"?@''z?'*4<:K+K'L%(f8N)N%O&-&K&K"88$)!-&D$ WlNNW&6DfggWm44&11$7 5 h O FgkkFU%%'9 +*. 54 hg ON G7 +**s`   C!G??)G'	($GG#G+G'	3G?
G:G?GGG$G'	'G72G??H	c                B   \         P                  ! 4       ;_uu_ 4       p\        V4      R ,          pVP                  \        P
                  ! RR./4      4       \        R$/ R\        P                  bR\        V4      bR\        \        V4      R,          4      bR\        \        V4      R,          4      bR	^bR
\        P                  bR\        P                  bR^ bRRbRRbRRbRRbR\        \        V4      R,          4      bRRbRRbRRbRRb p\        P                  ! \        R\        R7      ;_uu_ 4        \        P                  ! \        RR%R lR7      ;_uu_ 4        \        P                  ! \        R . R7      ;_uu_ 4       p\        P                  ! \        R!4      ;_uu_ 4       p\        P                  ! V4      pR"R"R"4       R"R"R"4       R"R"R"4       R"R"R"4       T P!                  X Uu. uF  qwP"                  NK  	  upR#.4       XP%                  4        XP%                  4        R"R"R"4       R"#   + '       g   i     L~; i  + '       g   i     L; i  + '       g   i     L; i  + '       g   i     L; iu upi   + '       g   i     R"# ; i)&rQ   re   rx   r0   rW   rX   rR   rY   rS   r6   rZ   r[   r\   r]   Fr^   r_   r`   Tcart_profilecart-profilecart_headlesscart_keep_openra   rT   rb   rU   rc   r4   r1   c                     V # r   r7   rz   s   &&r   r{   XRefurbishedWatcherTests.test_new_product_can_add_to_cart_before_notify.<locals>.<lambda>2  r}   r   r~   add_products_to_cartrd   Nr   r7   r   r   )r   rp   rW   rq   r`   rr   rs   r   s   &       r   .test_new_product_can_add_to_cart_before_notifyFRefurbishedWatcherTests.test_new_product_can_add_to_cart_before_notify  s*   ((**ff4J!!$**kJ<-H"IJ ''z? (+4<:K+K'L &)f8N)N%O	
  '.&K&K #88  %*    ! !f!>? $  %  .!" '#D* WlNNW&6DfggW&<2NNR]Wm44&11$7 5 O h O FgkkFU**,%%'C +*6 54 ON hg ON G? +**sx   DJ<)I5	%&I"$I/H<II"I5	J5J	)J<IIII""I2-I5	5J JJ	c                4   \         P                  ! 4       ;_uu_ 4       p\        V4      R ,          pVP                  \        P
                  ! RR./4      4       \        R%/ R\        P                  bR\        V4      bR\        \        V4      R,          4      bR\        \        V4      R,          4      bR	^bR
\        P                  bR\        P                  bR^ bRRbRRbRRbRRbR\        \        V4      R,          4      bRRbRRbRRbRRb p\        P                  ! \        R\        R7      ;_uu_ 4        \        P                  ! \        RR&R lR7      ;_uu_ 4        \        P                  ! \        R \        R!4      R7      ;_uu_ 4        \        P                  ! \        R"4      ;_uu_ 4       p\        P                   ! V4      pR#R#R#4       R#R#R#4       R#R#R#4       R#R#R#4       T P#                  X Uu. uF  qfP$                  NK  	  upR$.4       XP'                  4        R#R#R#4       R##   + '       g   i     Ln; i  + '       g   i     Ly; i  + '       g   i     L; i  + '       g   i     L; iu upi   + '       g   i     R## ; i)'rQ   re   rx   r0   rW   rX   rR   rY   rS   r6   rZ   r[   r\   r]   Fr^   r_   r`   Tr   r   r   r   ra   rT   rb   rU   rc   r4   r1   c                     V # r   r7   rz   s   &&r   r{   JRefurbishedWatcherTests.test_cart_failure_still_notifies.<locals>.<lambda>V  r}   r   r~   r   zmissing browserrd   Nr   r7   r   )rf   rg   r   r   rm   r   r   r   r   rh   ri   rj   r   r9   r   RuntimeErrorrk   r   r   r   r   s   &      r    test_cart_failure_still_notifies8RefurbishedWatcherTests.test_cart_failure_still_notifies<  s!   ((**ff4J!!$**kJ<-H"IJ ''z? (+4<:K+K'L &)f8N)N%O	
  '.&K&K #88  %*    ! !f!>? $  %  .!" '#D* WlNNW&6DfggW&<,WhJijjWm44&11$7 5 k h O FgkkFU%%'A +*6 54 kj hg ON G? +**sx   DJ<)I.	%/I$I8H5III.	'J>JJ5I IIII+&I.	.I>9JJ	c                    \        R R^R7      p\        P                  ! \        R4      ;_uu_ 4       p\        P                  ! V4       RRR4       XP                  4        R#   + '       g   i     L"; i)Funusedr`   r   r6   cart_setup_errorsN)r   r   r9   r   report_cart_setuprl   )r   rq   setup_errorss   &  r   2test_report_cart_setup_runs_only_when_cart_enabledJRefurbishedWatcherTests.test_report_cart_setup_runs_only_when_cart_enabled_  sN    U1M\\'#677<%%d+ 8 	&&( 87s   A##A3	c           	        \        R R^R7      p\        P                  ! RRRR7      p\        P                  ! \        RVR7      ;_uu_ 4        \        P                  ! \        R	R R7      ;_uu_ 4        \        P
                  ! V4       R
R
R
4       R
R
R
4       V P                  VP                  4       R
#   + '       g   i     L5; i  + '       g   i     L@; iTr   r   Flaunch_failedzcannot launchokcodemessagecart_setup_statusr4   prompt_yes_noN)r   r   CartSetupStatusr   r9   r   assertFalser`   r   rq   statuss   &  r   ;test_report_cart_setup_can_disable_cart_when_user_continuesSRefurbishedWatcherTests.test_report_cart_setup_can_disable_cart_when_user_continuesg  s    T!L((EQ`a LL"5FKKLL/EE%%d+ F L
 	))*	 FE LKs$   &C
3B7	
C
7CC

C	c                   \        R R^R7      p\        P                  ! RRRR7      p\        P                  ! \        RVR7      ;_uu_ 4        \        P                  ! \        R	RR7      ;_uu_ 4        V P                  \        4      ;_uu_ 4        \        P                  ! V4       R
R
R
4       R
R
R
4       R
R
R
4       R
#   + '       g   i     L"; i  + '       g   i     L-; i  + '       g   i     R
# ; ir   )r   r   r   r   r9   assertRaises
SystemExitr   r   s   &  r   =test_report_cart_setup_exits_when_user_declines_notifier_onlyURefurbishedWatcherTests.test_report_cart_setup_exits_when_user_declines_notifier_onlys  s    T!L((EQ`a LL"5FKKLL/FF"":..))$/ / G LK /. GF LKKs<   &C(3C	C(C	0C(CC	C% C((C9	c                   \        R R^R7      p\        P                  ! RRRR7      p\        P                  ! R RRR7      p\        P                  ! \        R	W#.R
7      ;_uu_ 4        \        P                  ! \        RR R7      ;_uu_ 4        \        P                  ! \        RR R7      ;_uu_ 4       p\        P
                  ! V4       RRR4       RRR4       RRR4       XP                  4        V P                  VP                  4       R#   + '       g   i     LM; i  + '       g   i     LX; i  + '       g   i     Lc; i)Tr   r   Fbrowser_missingzExecutable doesn't existr   r   zPlaywright can launch Chromium.r   r~   r   r4   install_playwright_chromiumN)	r   r   r   r   r9   r   r   
assertTruer`   )r   rq   missingr   installs   &    r   0test_report_cart_setup_installs_missing_chromiumHRefurbishedWatcherTests.test_report_cart_setup_installs_missing_chromium~  s    T!L))U9JTno$$4Abc LL"5G=QQLL/EELL"?dSSW^%%d+ T F R 	""$(() TS FE RQs<   '&D5&D"	3D
D"	D5DD"	"D2-D55E	c                    \         P                  ! R ^R7      p\         P                  ! \        \         P                  V4      pT P                  V Uu. uF  q3P                  NK  	  up. RO4       R# u upi )zmac mini)title_containsr[   N)zG4EEE/AzG4AAA/AzG4BBB/AzG4DDD/A)r   Criteriar   rA   r   r   r   )r   criteriar   r   s   &   r   0test_criteria_can_be_overridden_for_cart_testingHRefurbishedWatcherTests.test_criteria_can_be_overridden_for_cart_testing  sU    ##:"M(()?ATATV^_X>X'++X>@lm>s   A2c                R   \         P                  ! 4       ;_uu_ 4       p\        V4      R ,          pVP                  \        P
                  ! RR./4      4       \        \        P                  \        V4      \        \        V4      R,          4      \        \        V4      R,          4      ^R^@^RRRRRR	R
7      p\        P                  ! \        R\        R7      ;_uu_ 4        \        P                  ! \        RRR lR7      ;_uu_ 4        \        P                  ! V4      pRRR4       RRR4       T P                  X Uu. uF  qUP                  NK  	  upR.4       RRR4       R#   + '       g   i     LN; i  + '       g   i     LY; iu upi   + '       g   i     R# ; i)rQ   re   rx   rR   rS   
mac studioFTrT   rU   rV   rc   r4   r1   c                     V # r   r7   rz   s   &&r   r{   WRefurbishedWatcherTests.test_max_products_limits_handled_new_products.<locals>.<lambda>  r}   r   r~   Nr&   r   )rf   rg   r   r   rm   r   r   r   r   rh   r   r9   r)   rk   r   r   )r   rp   rW   rq   rs   r   s   &     r   -test_max_products_limits_handled_new_productsERefurbishedWatcherTests.test_max_products_limits_handled_new_products  s4   ((**ff4J!!$**kJ<-H"IJ''z?'*4<:K+K'L%(f8N)N%O&2$)!-&D$ WlAYZZW&6Dfgg&11$7 h [
 FgkkFT5 +*, hg [Z
 G5 +**sH   CF$)E=	E*$E=	,FF	F*E:5E=	=FFF&	c           	        \         P                  ! 4       ;_uu_ 4       p\        V4      R ,          p\        V4      R,          p\        P                  ! RRRR7      \        P                  ! RRRR7      .p\        P
                  ! WDR	,          W#4      p\        P
                  ! WDR	,          W#4      pV P                  VP                  4       V P                  VP                  4       VP                  4       P                  4       pV P                  \        V4      ^4       \        P                  ! V^ ,          4      pV P                  VR
,          ^4       V P                  VR,          R.4       RRR4       R#   + '       g   i     R# ; i)zhistory.jsonlrS   ARefurbished Mac mini16GBr   r/   r*   BRefurbished Mac Studior'   :r   NNtotal_productsmatched_keysN)rf   rg   r   r   r8   record_inventory_snapshotr   changedr   ro   
splitlinesr   lenrm   rn   )	r   rp   history_path
state_pathr   firstsecondlinesevents	   &        r   0test_record_inventory_snapshot_logs_only_changesHRefurbishedWatcherTests.test_record_inventory_snapshot_logs_only_changes  s"   ((**f</9Lf(>>JC/E6RC/GVTH
 55hlgE66x"|hFOOEMM*V^^, **,779ESZ+JJuQx(EU#34a8U>2SE:# +***s   EE::F	c                d   \         P                  ! 4       ;_uu_ 4       p\        V4      R ,          p\        P                  ! RRRR7      \        P                  ! RRRR7      .p\        P
                  ! RVR.R.. R	R
7      p\        P                  ! WB4       VP                  4       P                  4       pV P                  \        V4      ^4       \        P                  ! V^ ,          4      pV P                  VR,          R4       V P                  VR,          4       V P                  VR,          ^4       V P                  VR,          ^4       V P                  VR,          ^4       V P                  VR,          ^ 4       V P                  RV4       RRR4       R#   + '       g   i     R# ; i)polls.jsonlr   r   r   r   r   r   r'   abc123T)fingerprintr   r   
added_keysremoved_keysr   r   r   r   matched_countadded_countremoved_countr   N)rf   rg   r   r   r8   InventorySnapshotrecord_poll_snapshotro   r   r   r   rm   rn   r   assertNotIn)r   rp   poll_history_pathr   snapshotr   r   s   &      r   3test_record_poll_snapshot_logs_every_poll_compactlyKRefurbishedWatcherTests.test_record_poll_snapshot_logs_every_poll_compactly  sZ   ((**f $V} <C/E6RC/GVTH 00$!!U5H ((E%//1<<>ESZ+JJuQx(EU=18<OOE),-U#34a8U?3Q7U=115U?3Q7Z/5 +***s   E6FF/	c                l   \         P                  ! 4       ;_uu_ 4       p\        V4      R ,          p\        V4      R,          p\        V4      R,          p\        V4      R,          p\        \        P
                  \        V4      \        V4      \        V4      \        V4      ^\        P                  \        P                  ^ RRRRRRR7      p\        P                  ! \        R	\        R
7      ;_uu_ 4        \        P                  ! V4       \        P                  ! V4       RRR4       VP                  4       P                  4        Uu. uF  p\        P                   ! V4      NK  	  ppVP                  4       P                  4       p	V P#                  \%        V4      ^4       V P#                  \%        V	4      ^4       V P'                  V^ ,          R,          4       V P)                  V^,          R,          4       RRR4       R#   + '       g   i     L; iu upi   + '       g   i     R# ; i)rQ   rR   rS   r   FTrT    )r0   rW   rX   rY   poll_history_filer6   rZ   r[   r\   r]   r^   r_   r`   ra   rb   rc   r4   Nr   )rf   rg   r   r   r   r   rh   ri   rj   r   r9   r   rk   ro   r   rm   rn   r   r   r   r   )
r   rp   rW   rX   rY   r   rq   linepoll_eventsinventory_eventss
   &         r   Etest_check_once_records_poll_history_even_when_inventory_is_unchanged]RefurbishedWatcherTests.test_check_once_records_poll_history_even_when_inventory_is_unchanged  s   ((**ff4J%)&\4E%E"#'<2H#H  $V} <''z?'*+A'B%()=%>"%&7"8&-&K&K"88$)!-D$ g|,OO""4(""4( P 9J8S8S8U8`8`8bc8b4::d+8bKc5??ALLNS-q1S!12A6OOKN956[^I67A +*. PO d7 +**s1   CH"8-H
	%(H"H,BH"
HH""H3	c                   \         P                  ! 4       ;_uu_ 4       p\        V4      R ,          pVP                  RP	                  . R	O4      4       \
        P                  P                  R4      p\
        P                  P                  R4      p\
        P                  P                  R4      p R\
        P                  R&   \
        P                  P                  RR4       \
        P                  P                  RR4       \        P                  ! \        V4      4       V P                  \
        P                  R,          R4       V P                  \
        P                  R,          R4       V P                  \
        P                  R,          R4       \        RV4       \        RV4       \        RV4        RRR4       R#   \        RT4       \        RT4       \        RT4       i ; i  + '       g   i     R# ; i)
z
.env.local

NTFY_TOPICTARGET_TITLE_CONTAINS
MIN_RAM_GBzfrom-envNr   64)zNTFY_TOPIC=from-filez"TARGET_TITLE_CONTAINS='mac studio'zMIN_RAM_GB=64)rf   rg   r   r   joinr   r	   getr
   r   load_env_filerh   r   r   )r   rp   env_file	old_topic	old_titleold_rams   &     r   Etest_load_env_file_sets_missing_values_without_overriding_environment]RefurbishedWatcherTests.test_load_env_file_sets_missing_values_without_overriding_environment  se   ((**fF|l2H		 

|4I

'>?Ijjnn\2G3+5

<(

6=

|T2%%c(m4  L!9:F  ,C!DlS  L!94@L)43Y?L'29 +*4 L)43Y?L'29 +**s%   BG01C'G$G0&G--G00H	c                    \        R R RR7      pV P                  \        4      ;_uu_ 4        \        P                  ! V4       RRR4       R#   + '       g   i     R# ; i)Fr   r^   r_   rb   N)r   r   r   r   validate_args)r   rq   s   & r   7test_validate_args_requires_topic_for_notification_runsORefurbishedWatcherTests.test_validate_args_requires_topic_for_notification_runs#  s>    %rBz**!!$' +***s   AA	c                    \         P                  ! \        R RRR7      4       \         P                  ! \        RR RR7      4       R# )TFr   r  N)r   r  r   )r   s   &r   Ctest_validate_args_allows_missing_topic_when_notifications_disabled[RefurbishedWatcherTests.test_validate_args_allows_missing_topic_when_notifications_disabled)  s0    iRPQiRPQr   r7   N)__name__
__module____qualname____firstlineno__r   r#   r+   r>   rB   rJ   rN   ru   r   r   r   r   r   r   r   r   r   r   r   r   r   r  r  r  __static_attributes____classdictcell__)__classdict__s   @r   r   r      s     9'
3H'
A
?8?B(>"(H!(F)
+	0*nU:;(0:!8F3>(R Rr   r   __main__)rm   r   rf   unittestargparser   pathlibr   unittest.mockr   refurbished_watcherr   r   r!   rA   r)   r   TestCaser   r  mainr7   r   r   <module>r!     sr     	      %* * @( V cRh// cRL zMMO r   