Your IP : 216.73.216.213


Current Path : /opt/alt/python35/lib64/python3.5/test/__pycache__/
Upload File :
Current File : //opt/alt/python35/lib64/python3.5/test/__pycache__/test_webbrowser.cpython-35.opt-2.pyc



���]G�@svddlZddlZddlZddlmZddlmZdZdZGdd�dej�Z	Gdd	�d	�Z
Gd
d�de
ej�ZGdd
�d
e
ej�Z
Gdd�de
ej�ZGdd�de
ej�ZGdd�de
ej�ZGdd�de
ej�ZGdd�de
ej�ZGdd�de
ej�Zedkrrej�dS)�N)�mock)�supportzhttp://www.example.com�testc@s+eZdZdd�Zddd�ZdS)�	PopenMockcCsdS)Nr�)�selfrr�4/opt/alt/python35/lib64/python3.5/test_webbrowser.py�pollszPopenMock.pollNcCsdS)Nrr)rZsecondsrrr�waitszPopenMock.wait)�__name__�
__module__�__qualname__r	r
rrrrrsrc@s+eZdZdegdidd�ZdS)�CommandTestMixin�args�kwc
Cs�t�}tj|td|�|jdt�}t||�||�tjjdd}|j	|dt�|j
d�x4|D],}	|j|	|�|j
|j|	��q�W|j	||�dS)N�Popen�namer)
rrZpatch�
subprocess�
browser_class�CMD_NAME�getattrr�	call_argsZassertEqual�popZassertIn�index)
r�methrr�options�	arguments�popenZbrowserZ
popen_args�optionrrr�_tests	

zCommandTestMixin._testN)rrr
�URLrrrrrrsrc@s%eZdZejZdd�ZdS)�GenericBrowserCommandTestcCs |jddgdtg�dS)N�openrr)rr )rrrr�	test_open3sz#GenericBrowserCommandTest.test_openN)rrr
�
webbrowserZGenericBrowserrr#rrrrr!/s	r!c@s%eZdZejZdd�ZdS)�BackgroundBrowserCommandTestcCs |jddgdtg�dS)Nr"rr)rr )rrrrr#=sz&BackgroundBrowserCommandTest.test_openN)rrr
r$ZBackgroundBrowserrr#rrrrr%9s	r%c@sIeZdZejZdd�Zdd�Zdd�Zdd�Z	d	S)
�ChromeCommandTestcCs |jddgdtg�dS)Nr"rr)rr )rrrrr#GszChromeCommandTest.test_opencCs/|jddtdd�dgdtg�dS)Nr"r�	autoraiseFrr)r�dictr )rrrr�test_open_with_autoraise_falseLsz0ChromeCommandTest.test_open_with_autoraise_falsecCs#|jdddgdtg�dS)N�open_newrz--new-windowr)rr )rrrr�
test_open_newQs	zChromeCommandTest.test_open_newcCs |jddgdtg�dS)N�open_new_tabrr)rr )rrrr�test_open_new_tabVsz#ChromeCommandTest.test_open_new_tabN)
rrr
r$ZChromerr#r)r+r-rrrrr&Cs
	r&c@sIeZdZejZdd�Zdd�Zdd�Zdd�Z	d	S)
�MozillaCommandTestcCs |jddgdtg�dS)Nr"rr)rr )rrrrr#`szMozillaCommandTest.test_opencCs/|jddtdd�dgdtg�dS)Nr"rr'Frr)rr(r )rrrrr)esz1MozillaCommandTest.test_open_with_autoraise_falsecCs#|jddgddtg�dS)Nr*rrz-new-window)rr )rrrrr+jsz MozillaCommandTest.test_open_newcCs#|jddgddtg�dS)Nr,rrz-new-tab)rr )rrrrr-osz$MozillaCommandTest.test_open_new_tabN)
rrr
r$ZMozillarr#r)r+r-rrrrr.\s
	r.c@sIeZdZejZdd�Zdd�Zdd�Zdd�Z	d	S)
�NetscapeCommandTestcCs/|jddddgddjt�g�dS)Nr"rz-raisez-remoterzopenURL({}))r�formatr )rrrrr#yszNetscapeCommandTest.test_openc	Cs>|jddtdd�dddgdd	jt�g�dS)
Nr"rr'Frz-noraisez-remoterzopenURL({}))rr(r0r )rrrrr)~sz2NetscapeCommandTest.test_open_with_autoraise_falsecCs/|jddddgddjt�g�dS)Nr*rz-raisez-remoterzopenURL({},new-window))rr0r )rrrrr+�sz!NetscapeCommandTest.test_open_newcCs/|jddddgddjt�g�dS)Nr,rz-raisez-remoterzopenURL({},new-tab))rr0r )rrrrr-�sz%NetscapeCommandTest.test_open_new_tabN)
rrr
r$ZNetscaperr#r)r+r-rrrrr/us
	r/c@sIeZdZejZdd�Zdd�Zdd�Zdd�Z	d	S)
�GaleonCommandTestcCs#|jdddgdtg�dS)Nr"rz-nr)rr )rrrrr#�s	zGaleonCommandTest.test_opencCs5|jddtdd�dddgdtg�dS)	Nr"rr'Frz-noraisez-nr)rr(r )rrrrr)�sz0GaleonCommandTest.test_open_with_autoraise_falsecCs#|jdddgdtg�dS)Nr*rz-wr)rr )rrrrr+�s	zGaleonCommandTest.test_open_newcCs#|jdddgdtg�dS)Nr,rz-wr)rr )rrrrr-�s	z#GaleonCommandTest.test_open_new_tabN)
rrr
r$ZGaleonrr#r)r+r-rrrrr1�s
	r1c@sIeZdZejZdd�Zdd�Zdd�Zdd�Z	d	S)
�OperaCommandTestcCs,|jdddgddjt�g�dS)Nr"rz-remoterzopenURL({}))rr0r )rrrrr#�s	zOperaCommandTest.test_openc	Cs>|jddtdd�dddgdd	jt�g�dS)
Nr"rr'Frz-remotez-noraiserzopenURL({}))rr(r0r )rrrrr)�sz/OperaCommandTest.test_open_with_autoraise_falsecCs,|jdddgddjt�g�dS)Nr*rz-remoterzopenURL({},new-window))rr0r )rrrrr+�s	zOperaCommandTest.test_open_newcCs,|jdddgddjt�g�dS)Nr,rz-remoterzopenURL({},new-page))rr0r )rrrrr-�s	z"OperaCommandTest.test_open_new_tabN)
rrr
r$ZOperarr#r)r+r-rrrrr2�s
	r2c@sIeZdZejZdd�Zdd�Zdd�Zdd�Z	d	S)
�ELinksCommandTestcCs,|jdddgddjt�g�dS)Nr"rz-remoterzopenURL({}))rr0r )rrrrr#�szELinksCommandTest.test_opencCs,|jdddgddjt�g�dS)Nr"rz-remoterzopenURL({}))rr0r )rrrrr)�s	z0ELinksCommandTest.test_open_with_autoraise_falsecCs,|jdddgddjt�g�dS)Nr*rz-remoterzopenURL({},new-window))rr0r )rrrrr+�s	zELinksCommandTest.test_open_newcCs,|jdddgddjt�g�dS)Nr,rz-remoterzopenURL({},new-tab))rr0r )rrrrr-�s	z#ELinksCommandTest.test_open_new_tabN)
rrr
r$ZElinksrr#r)r+r-rrrrr3�s
	r3�__main__)r$Zunittestrrrrr rZ	MagicMockrrZTestCaser!r%r&r.r/r1r2r3r�mainrrrr�<module>s$