Your IP : 216.73.216.213


Current Path : /opt/alt/python36/lib64/python3.6/test/__pycache__/
Upload File :
Current File : //opt/alt/python36/lib64/python3.6/test/__pycache__/test_webbrowser.cpython-36.opt-1.pyc

3

� f��@sddlZddlZddlZddlmZddlmZdZdZGdd�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�Zedk�r
ej�dS)�N)�mock)�supportzhttp://www.example.com�testc@seZdZdd�Zddd�ZdS)�	PopenMockcCsdS)Nr�)�selfrr�9/opt/alt/python36/lib64/python3.6/test/test_webbrowser.py�pollszPopenMock.pollNcCsdS)Nrr)rZsecondsrrr�waitszPopenMock.wait)N)�__name__�
__module__�__qualname__r	r
rrrrrsrc@seZdZegid�dd�ZdS)�CommandTestMixin)�args�kwc
Cs�t�}tj|td|�|jtd�}t||�||�tjjdd}|j	|dt�|j
d�x(|D] }	|j|	|�|j
|j|	��qbW|j	||�dS)ajGiven 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)�namerN)
rrZpatch�
subprocess�
browser_class�CMD_NAME�getattrr�	call_argsZassertEqual�popZassertIn�index)
r�methrr�options�	arguments�popenZbrowserZ
popen_argsZoptionrrr�_tests

zCommandTestMixin._testN)rrr
�URLrrrrrrsrc@seZdZejZdd�ZdS)�GenericBrowserCommandTestcCs|jdgtgd�dS)N�open)rr)rr)rrrr�	test_open3sz#GenericBrowserCommandTest.test_openN)rrr
�
webbrowserZGenericBrowserrr"rrrrr /sr c@seZdZejZdd�ZdS)�BackgroundBrowserCommandTestcCs|jdgtgd�dS)Nr!)rr)rr)rrrrr"=sz&BackgroundBrowserCommandTest.test_openN)rrr
r#ZBackgroundBrowserrr"rrrrr$9sr$c@s2eZdZejZdd�Zdd�Zdd�Zdd�Z	d	S)
�ChromeCommandTestcCs|jdgtgd�dS)Nr!)rr)rr)rrrrr"GszChromeCommandTest.test_opencCs|jdtdd�gtgd�dS)Nr!F)�	autoraise)rrr)r�dictr)rrrr�test_open_with_autoraise_falseLsz0ChromeCommandTest.test_open_with_autoraise_falsecCs|jddgtgd�dS)N�open_newz--new-window)rr)rr)rrrr�
test_open_newQszChromeCommandTest.test_open_newcCs|jdgtgd�dS)N�open_new_tab)rr)rr)rrrr�test_open_new_tabVsz#ChromeCommandTest.test_open_new_tabN)
rrr
r#ZChromerr"r(r*r,rrrrr%Cs
r%c@s2eZdZejZdd�Zdd�Zdd�Zdd�Z	d	S)
�MozillaCommandTestcCs|jdgtgd�dS)Nr!)rr)rr)rrrrr"`szMozillaCommandTest.test_opencCs|jdtdd�gtgd�dS)Nr!F)r&)rrr)rr'r)rrrrr(esz1MozillaCommandTest.test_open_with_autoraise_falsecCs|jdgdtgd�dS)Nr)z-new-window)rr)rr)rrrrr*jsz MozillaCommandTest.test_open_newcCs|jdgdtgd�dS)Nr+z-new-tab)rr)rr)rrrrr,osz$MozillaCommandTest.test_open_new_tabN)
rrr
r#ZMozillarr"r(r*r,rrrrr-\s
r-c@s2eZdZejZdd�Zdd�Zdd�Zdd�Z	d	S)
�NetscapeCommandTestcCs |jdddgdjt�gd�dS)Nr!z-raisez-remotezopenURL({}))rr)r�formatr)rrrrr"yszNetscapeCommandTest.test_opencCs(|jdtdd�ddgdjt�gd�dS)Nr!F)r&z-noraisez-remotezopenURL({}))rrr)rr'r/r)rrrrr(~sz2NetscapeCommandTest.test_open_with_autoraise_falsecCs |jdddgdjt�gd�dS)Nr)z-raisez-remotezopenURL({},new-window))rr)rr/r)rrrrr*�sz!NetscapeCommandTest.test_open_newcCs |jdddgdjt�gd�dS)Nr+z-raisez-remotezopenURL({},new-tab))rr)rr/r)rrrrr,�sz%NetscapeCommandTest.test_open_new_tabN)
rrr
r#ZNetscaperr"r(r*r,rrrrr.us
r.c@s2eZdZejZdd�Zdd�Zdd�Zdd�Z	d	S)
�GaleonCommandTestcCs|jddgtgd�dS)Nr!z-n)rr)rr)rrrrr"�szGaleonCommandTest.test_opencCs"|jdtdd�ddgtgd�dS)Nr!F)r&z-noraisez-n)rrr)rr'r)rrrrr(�sz0GaleonCommandTest.test_open_with_autoraise_falsecCs|jddgtgd�dS)Nr)z-w)rr)rr)rrrrr*�szGaleonCommandTest.test_open_newcCs|jddgtgd�dS)Nr+z-w)rr)rr)rrrrr,�sz#GaleonCommandTest.test_open_new_tabN)
rrr
r#ZGaleonrr"r(r*r,rrrrr0�s
r0c@s2eZdZejZdd�Zdd�Zdd�Zdd�Z	d	S)
�OperaCommandTestcCs|jdgtgd�dS)Nr!)rr)rr)rrrrr"�szOperaCommandTest.test_opencCs|jdtdd�gtgd�dS)Nr!F)r&)rrr)rr'r)rrrrr(�sz/OperaCommandTest.test_open_with_autoraise_falsecCs|jddgtgd�dS)Nr)z--new-window)rr)rr)rrrrr*�szOperaCommandTest.test_open_newcCs|jdgtgd�dS)Nr+)rr)rr)rrrrr,�sz"OperaCommandTest.test_open_new_tabN)
rrr
r#ZOperarr"r(r*r,rrrrr1�s
r1c@s2eZdZejZdd�Zdd�Zdd�Zdd�Z	d	S)
�ELinksCommandTestcCs|jddgdjt�gd�dS)Nr!z-remotezopenURL({}))rr)rr/r)rrrrr"�s
zELinksCommandTest.test_opencCs|jddgdjt�gd�dS)Nr!z-remotezopenURL({}))rr)rr/r)rrrrr(�sz0ELinksCommandTest.test_open_with_autoraise_falsecCs|jddgdjt�gd�dS)Nr)z-remotezopenURL({},new-window))rr)rr/r)rrrrr*�szELinksCommandTest.test_open_newcCs|jddgdjt�gd�dS)Nr+z-remotezopenURL({},new-tab))rr)rr/r)rrrrr,�sz#ELinksCommandTest.test_open_new_tabN)
rrr
r#ZElinksrr"r(r*r,rrrrr2�s
r2�__main__)r#ZunittestrrrrrrZ	MagicMockrrZTestCaser r$r%r-r.r0r1r2r�mainrrrr�<module>s$