+
    BiN                     @   ^ RI t ^ RIt^ RIt^ RIt^ 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Ht ^ RIHt ^ RIHt ^ RIHt ^ R	IHt ]P&                  ! R
R7       RtRt ! R R]P,                  4      t]! 4        ! R R4      4       t ! R R]]P2                  4      t ! R R]]P2                  4      t ! R R]]P2                  4      t ! R R]]P2                  4      t ! R R]]P2                  4      t ! R R]]P2                  4      t ! R R]]P2                  4      t  ! R  R!]]P2                  4      t!]PD                  ! ]PF                  R"8H  R#4       ! R$ R%]P2                  4      4       t$ ! R& R'4      t%]PD                  ! ]PF                  R(8H  R)4      ]! 4        ! R* R+]P2                  4      4       4       t& ! R, R-]P2                  4      t' ! R. R/]P2                  4      t( ! R0 R1]P2                  4      t)]*R28X  d   ]PV                  ! 4        R# R# )3    N)partial)support)import_helper)is_apple_mobile)	os_helper)requires_subprocess)threading_helper)mockT)modulezhttps://www.example.comtestc                   0   a  ] tR t^t o R tRR ltRtV tR# )	PopenMockc                    ^ # r    selfs   &+/usr/lib/python3.14/test/test_webbrowser.pypollPopenMock.poll           Nc                    ^ # r   r   )r   secondss   &&r   waitPopenMock.wait   r   r   r   N)__name__
__module____qualname____firstlineno__r   r   __static_attributes____classdictcell____classdict__s   @r   r   r      s      r   r   c                   4   a  ] tR t^"t o R].R/ /R ltRtV tR# )CommandTestMixinargskwc                  \        4       p\        P                  ! V \        RV4       V P	                  \
        R7      p\        Wq4      ! V/ VB  \        P                  P                  ^ ,          ^ ,          pV P                  V^ ,          \
        4       VP                  ^ 4       V F4  p	V P                  W4       VP                  VP                  V	4      4       K6  	  V P                  W4       R# )a*  Given a web browser instance method name along with arguments and
keywords for same (which defaults to the single argument URL), creates
a browser instance from the class pointed to by self.browser, calls the
indicated instance method with the indicated arguments, and compares
the resulting options and arguments passed to Popen by the browser
instance against the 'options' and 'args' lists.  Options are compared
in a position independent fashion, and the arguments are compared in
sequence order to whatever is left over after removing the options.

Popen)nameN)r   r   patch
subprocessbrowser_classCMD_NAMEgetattrr+   	call_argsassertEqualpopassertInindex)
r   methr(   r)   options	argumentspopenbrowser
popen_argsoptions
   &&$$$$    r   _testCommandTestMixin._test%   s     dJ7$$($3++%%//215
A1qFMM&-NN:++F34  	/r   r   N)r   r   r    r!   URLr>   r"   r#   r$   s   @r   r'   r'   "   s     03% 0B 0 0r   r'   c                   >   a  ] tR t^=t o ]P
                  tR tRtV t	R# )GenericBrowserCommandTestc                8    V P                  R . \        .R7       R# openr8   r9   Nr>   r@   r   s   &r   	test_open#GenericBrowserCommandTest.test_openA       

6!U 	 	$r   r   N)
r   r   r    r!   
webbrowserGenericBrowserr/   rH   r"   r#   r$   s   @r   rB   rB   =   s     --M$ $r   rB   c                   >   a  ] tR t^Gt o ]P
                  tR tRtV t	R# )BackgroundBrowserCommandTestc                8    V P                  R . \        .R7       R# rD   rG   r   s   &r   rH   &BackgroundBrowserCommandTest.test_openK   rJ   r   r   N)
r   r   r    r!   rK   BackgroundBrowserr/   rH   r"   r#   r$   s   @r   rN   rN   G   s     00M$ $r   rN   c                   V   a  ] tR t^Qt o ]P
                  tR tR tR t	R t
R tRtV tR# )ChromeCommandTestc                8    V P                  R . \        .R7       R# rD   rG   r   s   &r   rH   ChromeCommandTest.test_openU   rJ   r   c                N    V P                  R \        RR7      . \        .R7       R# rE   F	autoraiser)   r8   r9   Nr>   dictr@   r   s   &r   test_open_with_autoraise_false0ChromeCommandTest.test_open_with_autoraise_falseZ   $    

6dU3!U 	 	$r   c                :    V P                  R R.\        .R7       R# open_newz--new-windowrF   NrG   r   s   &r   test_open_newChromeCommandTest.test_open_new_        

:*+!U 	 	$r   c                8    V P                  R . \        .R7       R# open_new_tabrF   NrG   r   s   &r   test_open_new_tab#ChromeCommandTest.test_open_new_tabd       

>!U 	 	$r   c                    V P                  \        P                  \        P                  ! R 4      4      ;_uu_ 4        V P                  R. \        .\        RR7      R7       RRR4       R#   + '       g   i     R# ; i)z;Bad 'new' parameter to open(); expected 0, 1, or 2, got 999rE   i  )new)r8   r9   r)   N)assertRaisesRegexrK   Errorreescaper>   r@   r\   r   s   &r   test_open_bad_new_parameter-ChromeCommandTest.test_open_bad_new_parameteri   so    ##J$4$4$&II /M %NO O JJv!"%3-  )O O O Os   %A,,A=	r   N)r   r   r    r!   rK   Chromer/   rH   r]   rc   ri   rr   r"   r#   r$   s   @r   rS   rS   Q   s.     %%M$
$
$
$
) )r   rS   c                   P   a  ] tR t^st o ]P
                  tR tR tR t	R t
RtV tR# )EdgeCommandTestc                8    V P                  R . \        .R7       R# rD   rG   r   s   &r   rH   EdgeCommandTest.test_openw   rJ   r   c                N    V P                  R \        RR7      . \        .R7       R# rW   r[   r   s   &r   r]   .EdgeCommandTest.test_open_with_autoraise_false|   r_   r   c                :    V P                  R R.\        .R7       R# ra   rG   r   s   &r   rc   EdgeCommandTest.test_open_new   re   r   c                8    V P                  R . \        .R7       R# rg   rG   r   s   &r   ri   !EdgeCommandTest.test_open_new_tab   rk   r   r   N)r   r   r    r!   rK   Edger/   rH   r]   rc   ri   r"   r#   r$   s   @r   rv   rv   s   s'     OOM$
$
$
$ $r   rv   c                   P   a  ] tR t^t o ]P
                  tR tR tR t	R t
RtV tR# )MozillaCommandTestc                8    V P                  R . \        .R7       R# rD   rG   r   s   &r   rH   MozillaCommandTest.test_open   rJ   r   c                N    V P                  R \        RR7      . \        .R7       R# rW   r[   r   s   &r   r]   1MozillaCommandTest.test_open_with_autoraise_false   r_   r   c                :    V P                  R . R\        .R7       R# )rb   z-new-windowrF   NrG   r   s   &r   rc    MozillaCommandTest.test_open_new   s     

:+S1 	 	3r   c                :    V P                  R . R\        .R7       R# )rh   z-new-tabrF   NrG   r   s   &r   ri   $MozillaCommandTest.test_open_new_tab   s     

>(#. 	 	0r   r   N)r   r   r    r!   rK   Mozillar/   rH   r]   rc   ri   r"   r#   r$   s   @r   r   r      s)     &&M$
$
3
0 0r   r   c                   P   a  ] tR t^t o ]P
                  tR tR tR t	R t
RtV tR# )EpiphanyCommandTestc                :    V P                  R R.\        .R7       R# )rE   -nrF   NrG   r   s   &r   rH   EpiphanyCommandTest.test_open   s    

6 6!U 	 	$r   c                R    V P                  R \        RR7      RR.\        .R7       R# )rE   FrX   z-noraiser   rZ   Nr[   r   s   &r   r]   2EpiphanyCommandTest.test_open_with_autoraise_false   s)    

6dU3&-!U 	 	$r   c                :    V P                  R R.\        .R7       R# )rb   -wrF   NrG   r   s   &r   rc   !EpiphanyCommandTest.test_open_new   s    

: 6!U 	 	$r   c                :    V P                  R R.\        .R7       R# )rh   r   rF   NrG   r   s   &r   ri   %EpiphanyCommandTest.test_open_new_tab   s    

> 6!U 	 	$r   r   N)r   r   r    r!   rK   Epiphanyr/   rH   r]   rc   ri   r"   r#   r$   s   @r   r   r      s)     ''M$
$
$
$ $r   r   c                   P   a  ] tR t^t o ]P
                  tR tR tR t	R t
RtV tR# )OperaCommandTestc                8    V P                  R . \        .R7       R# rD   rG   r   s   &r   rH   OperaCommandTest.test_open   rJ   r   c                N    V P                  R \        RR7      . \        .R7       R# rW   r[   r   s   &r   r]   /OperaCommandTest.test_open_with_autoraise_false   r_   r   c                :    V P                  R R.\        .R7       R# ra   rG   r   s   &r   rc   OperaCommandTest.test_open_new   re   r   c                8    V P                  R . \        .R7       R# rg   rG   r   s   &r   ri   "OperaCommandTest.test_open_new_tab   rk   r   r   N)r   r   r    r!   rK   Operar/   rH   r]   rc   ri   r"   r#   r$   s   @r   r   r      s)     $$M$
$
$
$ $r   r   c                   P   a  ] tR t^t o ]P
                  tR tR tR t	R t
RtV tR# )ELinksCommandTestc                B    V P                  R R.R\         R2.R7       R# rE   -remoteopenURL()rF   NrG   r   s   &r   rH   ELinksCommandTest.test_open   s(    

6I; (Q/0 	 	2r   c                B    V P                  R R.R\         R2.R7       R# r   rG   r   s   &r   r]   0ELinksCommandTest.test_open_with_autoraise_false   s)    

6%; (Q/0 	 	2r   c                B    V P                  R R.R\         R2.R7       R# )rb   r   r   z,new-window)rF   NrG   r   s   &r   rc   ELinksCommandTest.test_open_new   s)    

:%; (\:; 	 	=r   c                B    V P                  R R.R\         R2.R7       R# )rh   r   r   z	,new-tab)rF   NrG   r   s   &r   ri   #ELinksCommandTest.test_open_new_tab   s)    

>%; (Y78 	 	:r   r   N)r   r   r    r!   rK   Elinksr/   rH   r]   rc   ri   r"   r#   r$   s   @r   r   r      s)     %%M22
=
: :r   r   ioszTest only applicable to iOSc                      a  ] tR t^t o R t]P                  ! ]! ]RR4      RJ R4      R 4       t	R t
R tR tR	 tR
 tR tRtV tR# )IOSBrowserTestc                2    R P                  R V 4       4      # )|c              3   8   "   T F  p\        V4      x  K  	  R # 5ir   )str).0as   & r   	<genexpr>*IOSBrowserTest._obj_ref.<locals>.<genexpr>   s     -1As   )join)r   r(   s   &*r   _obj_refIOSBrowserTest._obj_ref   s     xx----r   objcNz#iOS Webbrowser tests require ctypesc                   \         P                  V n        \        P                  ! 4       \         n        R  \         P                  n        R \         P                  n        V P                  \         P                  P                  n	        R# )c                 (    R V P                  4        2# )zC#decode)clss   &r   <lambda>&IOSBrowserTest.setUp.<locals>.<lambda>   s    b4Gr   c                 (    R V P                  4        2# )zS#r   )sels   &r   r   r      s    CJJL>7Jr   N)
rK   r   	orig_objcr
   Mockobjc_getClasssel_registerNamer   objc_msgSendside_effectr   s   &r   setUpIOSBrowserTest.setUp   sJ     $))+
(G
%+J
(37==
$$0r   c                0    V P                   \        n        R # r   )r   rK   r   r   s   &r   tearDownIOSBrowserTest.tearDown  s    ..
r   c                   \        \        V4      ! \        3/ VB  . ROpRRV P                  ! V!  .pRR.p\        P                  P
                  P                  V P                  ! V!  RV P                  ! V!  RR4       R# )
C#NSStringzC#NSURLzS#URLWithString:zC#UIApplicationzS#sharedApplicationz$S#openURL:options:completionHandler:N)r   zS#stringWithCString:encoding:s   https://www.example.com   )r1   rK   r@   r   r   r   assert_called_with)r   r7   kwargsurl_string_argsurl_obj_argsshared_app_argss   &&,   r   r>   IOSBrowserTest._test  s     	
D!#00
 MM?+
 -.CD 	$$77MM?+2MM<(	
r   c                (    V P                  R 4       R# )rE   Nr>   r   s   &r   rH   IOSBrowserTest.test_open%  s    

6r   c                ,    V P                  R RR7       R# )rE   FrX   Nr   r   s   &r   r]   -IOSBrowserTest.test_open_with_autoraise_false(  s    

6U
+r   c                (    V P                  R 4       R# )rb   Nr   r   s   &r   rc   IOSBrowserTest.test_open_new+  s    

:r   c                (    V P                  R 4       R# )rh   Nr   r   s   &r   ri    IOSBrowserTest.test_open_new_tab.  s    

>"r   )r   )r   r   r    r!   r   unittestskipIfr1   rK   r   r   r>   rH   r]   rc   ri   r"   r#   r$   s   @r   r   r      s_     .
 __WZ6$>:<	A<	A)
>,# #r   r   c                   2   a  ] tR tRt o R tR tR tRtV tR# )MockPopenPipei2  c                `    Wn         W n        \        P                  ! 4       V n        R V n        R# )FN)cmdmodeioStringIOpipe_closedr   r   r   s   &&&r   __init__MockPopenPipe.__init__3  s     	KKM	r   c                <    V P                   P                  V4       R # r   )r   write)r   bufs   &&r   r   MockPopenPipe.write9  s    		r   c                    R V n         R# )TN)r   r   s   &r   closeMockPopenPipe.close<  s    r   )r   r   r   r   N)	r   r   r    r!   r   r   r   r"   r#   r$   s   @r   r   r   2  s      r   r   darwinmacOS specific testc                   J   a  ] tR tRt o R tR tR tR tR tR t	R t
R	tV tR
# )MacOSXOSAScriptTestiA  c                    V P                  \        P                  ! 4       4      pVP                  R 4       \        P
                  ! V \        RV P                  4       \        P                  ! R4      V n
        R# )BROWSERr:   defaultN)enterContextr   EnvironmentVarGuardunsetr   r-   os
mock_popenrK   MacOSXOSAScriptr;   )r   envs   & r   r   MacOSXOSAScriptTest.setUpE  sQ     	 = = ?@		)dB9!11)<r   c                :    \        W4      V n        V P                  # r   )r   
popen_piper   s   &&&r   r  MacOSXOSAScriptTest.mock_popenN  s    '2r   c                h    \         P                  ! 4       pV P                  VP                  R 4       R# )r  N)rK   getr3   r,   )r   r;   s   & r   test_default MacOSXOSAScriptTest.test_defaultR  s"    .."y1r   c                f   R pV P                   P                  V4       V P                  V P                  P                  4       V P                  V P                  P                  R4       V P                  P                  P                  4       pV P                  VP                  4       RV R24       R# )https://python.org	osascriptopen location ""N)
r;   rE   
assertTruer  r   r3   r   r   getvaluestripr   urlscripts   &  r   test_default_open%MacOSXOSAScriptTest.test_default_openW  s    "#//0,,k:%%..0?3%q)ABr   c                    V P                   P                  R 4       V P                  P                  P	                  4       pV P                  VP                  4       R4       R# )zhttps://python.org/"quote"z.open location "https://python.org/%22quote%22"N)r;   rE   r  r   r  r3   r  )r   r  s   & r   test_url_quote"MacOSXOSAScriptTest.test_url_quote_  sG    67%%..0LLNL	
r   c                    R pV P                   P                  V4       V P                  P                  P	                  4       pV P                  RV4       V P                  RV R2V4       R# )zfile:///tmp/some-file.htmlURLForApplicationToOpenURLr  r  N)r;   rE   r  r   r  r5   r  s   &  r   test_default_browser_lookup/MacOSXOSAScriptTest.test_default_browser_lookupf  sY    *#%%..0 	2F;uA.7r   c                    \         P                  ! R 4      pVP                  R4       V P                  P                  P                  4       pV P                  RV4       V P                  RV4       R# )safarir  ztell application "safari"z"open location "https://python.org"N)rK   r  rE   r  r   r  r5   )r   r;   r  s   &  r   test_explicit_browser)MacOSXOSAScriptTest.test_explicit_browsero  sU    ,,X6)*%%..016::FCr   )r;   r  N)r   r   r    r!   r   r  r  r  r   r$  r(  r"   r#   r$   s   @r   r   r   A  s0     =2
C
8D Dr   r   c                      a  ] tR tRt o R tR tR tR tR tR t	]
P                  ! ]P                  R8H  R	4      R
 4       tRtV tR# )BrowserRegistrationTestiw  c                    \         P                  V n        . \         n        \         P                  V n        / \         n        R # r   )rK   	_tryorder_saved_tryorder	_browsers_saved_browsersr   s   &r   r   BrowserRegistrationTest.setUpy  s.    )33!
)33!
r   c                Z    V P                   \        n        V P                  \        n        R # r   )r.  rK   r-  r0  r/  r   s   &r   r    BrowserRegistrationTest.tearDown  s    #33
#33
r   c                    ! R  R4      p. p/ pV P                  \        P                  V4       V P                  \        P                  V4       \        P                  ! RV4       R.pVR.VR&   V P                  \        P                  V4       V P                  \        P                  V4       V! 4       pVe   \        P                  ! RW%VR7       M\        P                  ! RW%4       V'       d   RR.pMRR.pW%.VR&   V P                  \        P                  V4       V P                  \        P                  V4       R# )c                       ] tR tRtRtR# )CBrowserRegistrationTest._check_registration.<locals>.ExampleBrowseri  r   Nr   r   r    r!   r"   r   r   r   ExampleBrowserr6        r   r8  Example1Nexample1example2	preferred)r3   rK   r-  r/  register)r   r>  r8  expected_tryorderexpected_browsersinstances   &&    r   _check_registration+BrowserRegistrationTest._check_registration  s(   	 	 --/@A--/@AJ7'L)7(>*%--/@A--/@A!# 
N*35 
NE!+Z 8!+Z 8)7(B*%--/@A--/@Ar   c                *    V P                  R R7       R# )Fr=  NrC  r   s   &r   test_register%BrowserRegistrationTest.test_register  s      5 1r   c                *    V P                  R R7       R # )Nr=  rF  r   s   &r   test_register_default-BrowserRegistrationTest.test_register_default        4 0r   c                *    V P                  R R7       R# )Tr=  NrF  r   s   &r   test_register_preferred/BrowserRegistrationTest.test_register_preferred  rL  r   r   r   c                    \         P                  ! R 4      ;_uu_ 4       p\        P                  ! 4        RRR4       XP	                  4        R#   + '       g   i     L"; i)zsubprocess.check_outputN)r
   r-   rK   register_standard_browsersassert_not_called)r   ck_os   & r   test_no_xdg_settings_on_macOS5BrowserRegistrationTest.test_no_xdg_settings_on_macOS  s>    
 ZZ122d113 3 	  32s   AA	)r0  r.  N)r   r   r    r!   r   r   rC  rG  rJ  rN  r   
skipUnlesssysplatformrT  r"   r#   r$   s   @r   r+  r+  w  sP     "4B<211 13HI! J!r   r+  c                      a  ] tR tRt o R tR t]P                  ! R]P                  9   R4      R 4       t
]P                  ! ]R4      R 4       t]P                  ! ]R4      R	 4       tR
tV tR# )
ImportTesti  c                   \         P                  ! R 4      pV P                  VP                  4       V P	                  VP
                  4        ! R R4      pVP                  ! RV4       V P                  VP                  4       V P                  VP                  R,          R4       V P                  VP
                  4       V P                  RVP
                  4       V P                  VP
                  R,          VR.4       R# )rK   c                       ] tR tRtRtR# )0ImportTest.test_register.<locals>.ExampleBrowseri  r   Nr7  r   r   r   r8  r]    r9  r   r8  r:  r;  N)
r   import_fresh_moduleassertIsNoner-  assertFalser/  r?  r  r3   r5   )r   rK   r8  s   &  r   rG  ImportTest.test_register  s    "66|D
*../--.	 	J7
,,---b1:>
,,-j*"6"67--j9ND;QRr   c                v   \         P                  ! R 4      pV P                  VP                  4       V P	                  VP
                  4       V P                  VP                  4      ;_uu_ 4        VP                  ! R4       RRR4       V P                  VP                  4       R#   + '       g   i     L-; i)rK   fakebrowserN)
r   r_  r`  r-  ra  r/  assertRaisesro   r  assertIsNotNone)r   rK   s   & r   test_getImportTest.test_get  s    "66|D
*../--.z//00NN=) 1Z112 10s   0B((B8	 z)test assumes no space in path (GH-114452)c                0   \         P                  ! R 4      p\        P                  P	                  \
        P                  4      P                  4       pVP                  ! VRVP                  ! V4      4       VP                  ! \
        P                  4       R# )rK   N)r   r_  r  pathbasenamerW  
executablelowerr?  rL   r  )r   rK   r,   s   &  r   test_synthesizeImportTest.test_synthesize  s`    "66|D
ww/557D$
(A(A$(GHs~~&r   z=Apple mobile doesn't allow modifying browser with environmentc                   \         P                  ! R 4      p VP                  ! 4       P                  p\        P                  ! 4       ;_uu_ 4       pXVR&   \         P                  ! R 4      pVP                  ! 4        RRR4       R#   TP                   d%   pT P                  \        T4      4        Rp?LRp?ii ; i  + '       g   i     R# ; i)rK   Nr  )	r   r_  r  r,   ro   skipTestr   r   r  )r   rK   r;   errr	  s   &    r   test_environmentImportTest.test_environment  s    
 #66|D
	$ nn&++G **,,$C	N&::<HJNN -,  	$MM#c(##	$,,,s#   B -B?B<B77B<?C	c                d   \         P                  ! R 4      p VP                  ! 4        VP                  ! VP                  R,          4      P                  p\        P                  ! 4       ;_uu_ 4       pXVR&   \         P                  ! R 4      pV P                  VP                  ! 4       P                  V4       RRR4       \        P                  ! 4       ;_uu_ 4       p\        P                  VR&   \         P                  ! R 4      pV P                  VP                  ! 4       P                  \        P                  4       RRR4       R#   TP
                  \        3 d&   pT P                  \        T4      4        Rp?EL-Rp?ii ; i  + '       g   i     L; i  + '       g   i     R# ; i)rK   Nr  r^  )r   r_  r  r-  r,   ro   
IndexErrorrr  r   r   r  r3   rW  rm  )r   rK   least_preferred_browserrs  r	  s   &    r   test_environment_preferred%ImportTest.test_environment_preferred  s0   
 #66|D
	$NN&0nnZ5I5I"5M&N&S&S# **,,4C	N&::<HJZ^^-224KL -
 **,, ^^C	N&::<HJZ^^-22CNNC -,   *- 	$MM#c(##	$ -,
 -,,s1   >E 3AFA#FF#FFF	F/	r   N)r   r   r    r!   rG  rg  r   r   rW  rm  ro  r   rt  ry  r"   r#   r$   s   @r   rZ  rZ    s     S3 __SCNN*,WX' Y' __G			 __GD	Dr   rZ  c                   2   a  ] tR tRt o R tR tR tRtV tR# )CliTesti  c                    R Fh  w  rp\         P                  ! \        P                  ! V4      4      pV P	                  VP
                  V4       V P	                  VP                  V4       Kj  	  R# )https://example.comN	)r~  r~  r   )zhttps://example.com -nr~     )z-n https://example.comr~  r  )zhttps://example.com -tr~     )z-t https://example.comr~  r  )z https://example.com --new-windowr~  r  )z --new-window https://example.comr~  r  )zhttps://example.com --new-tabr~  r  )z--new-tab https://example.comr~  r  )rK   
parse_argsshlexsplitr3   r  new_win)r   commandr  r  r(   s   &    r   test_parse_argsCliTest.test_parse_args  sV    &
!G' ((W)=>DTXXs+T\\73#&
r   c           
        R F  p\         P                  ! 4       ;_uu_ 4       pV P                  \        4      ;_uu_ 4        \        P
                  ! \        P                  ! V4      4       RRR4       V P                  RVP                  4       4       RRR4       K  	  \         P                  ! 4       ;_uu_ 4       pV P                  \        4      ;_uu_ 4        \        P
                  ! \        P                  ! R4      4       RRR4       V P                  RVP                  4       4       RRR4       R#   + '       g   i     L; i  + '       g   i     EKZ  ; i  + '       g   i     Lb; i  + '       g   i     R# ; i)https://example.com -n -tNzGerror: argument -t/--new-tab: not allowed with argument -n/--new-windowzhttps://example.com --newzBerror: ambiguous option: --new could match --new-window, --new-tab)r  z*https://example.com --new-window --new-tabz https://example.com -n --new-tabz#https://example.com --new-window -t)
r   captured_stderrre  
SystemExitrK   r  r  r  r5   r  )r   r  stderrs   &  r   test_parse_args_errorCliTest.test_parse_args_error  s    
G ((**f&&z22))%++g*>? 3]OO% +*
  $$&&&"":..%%ekk2M&NO /MMT! '& 32 +** /. '&&sG   E+D8,(E=E3+E 	(E38EEE E0+E33F	c           
        R F  w  rp\         P                  ! RRR7      ;_uu_ 4       p\         P                  ! RRR7      ;_uu_ 4        \        P                  ! \        P
                  ! V4      4       VP                  W#4       RRR4       RRR4       K  	  R#   + '       g   i     L; i  + '       g   i     K  ; i)r~  zwebbrowser.openN)return_valuezbuiltins.printr  )r
   r-   rK   mainr  r  assert_called_once_with)r   r  expected_urlexpected_new_win	mock_opens   &    r   	test_mainCliTest.test_main)  s    8
3G#3 

,4@@I

+$??G 4511,Q @ A@8
  @? A@@s#   !B/
<BB/B,'B//C r   N)	r   r   r    r!   r  r  r  r"   r#   r$   s   @r   r|  r|    s     4(2R Rr   r|  __main__),r   r  rp   r  r.   rW  r   rK   	functoolsr   r   r   test.supportr   r   r   r   r	   r
   requires_working_threadingr@   r0   	MagicMockr   r'   TestCaserB   rN   rS   rv   r   r   r   r   rV  rX  r   r   r   r+  rZ  r|  r   r  r   r   r   <module>r     s	   	 	 	   
     & ( " , )   + +4 8  0 0 04$ 0(2C2C $$#3X5F5F $)((*;*; )D$&(9(9 $20)8+<+< 02$*H,=,= $2$'):): $2:((*;*; :0 
S\\U*,IJ?#X&& ?# K?#D  
S\\X-/DE1D(++ 1D  F1Dh<!h// <!~BD"" BDJBRh BRJ zMMO r   