File: //usr/local/lib/python3.10/test/__pycache__/test_webbrowser.cpython-310.pyc
o
�ib* � @ s\ d dl Z d dlZd dlZd dlZd dlZd dlmZ d dlmZ d dlm Z d dlm
Z
dZdZG dd � d ej
�ZG d
d� d�ZG dd
� d
eej�ZG dd� deej�ZG dd� deej�ZG dd� deej�ZG dd� deej�ZG dd� deej�ZG dd� deej�ZG dd� deej�ZG dd� dej�ZG dd� dej�Zed kr�e�� dS dS )!� N)�mock)�support)�
import_helper)� os_helperzhttp://www.example.com�testc @ s e Zd Zdd� Zddd�ZdS )� PopenMockc C � dS �Nr � ��selfr
r
�1/usr/local/lib/python3.10/test/test_webbrowser.py�poll � zPopenMock.pollNc C r r r
)r Zsecondsr
r
r
�wait r zPopenMock.wait�N)�__name__�
__module__�__qualname__r r r
r
r
r
r s r c @ s e Zd Zegi d�dd�ZdS )�CommandTestMixin)�args�kwc
C s� t � }t�| td|� | jtd�}t||�|i |�� tjjd d }| � |d t� |�
d� |D ]} | �| |� |�
|�| �� q2| � ||� dS )aj 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)�namer N)
r r Zpatch�
subprocess�
browser_class�CMD_NAME�getattrr Z call_args�assertEqual�pop�assertIn�index)
r �methr r �options� arguments�popen�browserZ
popen_args�optionr
r
r
�_test s
zCommandTestMixin._testN)r r r �URLr( r
r
r
r
r s r c @ � e Zd ZejZdd� ZdS )�GenericBrowserCommandTestc C � | j dg tgd� d S �N�open�r# r$ �r( r) r r
r
r
� test_open7 �
�z#GenericBrowserCommandTest.test_openN)r r r �
webbrowser�GenericBrowserr r1 r
r
r
r
r+ 3 � r+ c @ r* )�BackgroundBrowserCommandTestc C r, r- r0 r r
r
r
r1 A r2 z&BackgroundBrowserCommandTest.test_openN)r r r r3 ZBackgroundBrowserr r1 r
r
r
r
r6 = r5 r6 c @ �2 e Zd ZejZdd� Zdd� Zdd� Zdd� Z d S )
�ChromeCommandTestc C r, r- r0 r r
r
r
r1 K r2 zChromeCommandTest.test_openc C � | j dtdd�g tgd� d S �Nr. F�Z autoraise�r r# r$ �r( �dictr) r r
r
r
�test_open_with_autoraise_falseP �
�z0ChromeCommandTest.test_open_with_autoraise_falsec C � | j ddgtgd� d S �N�open_newz--new-windowr/ r0 r r
r
r
�
test_open_newU �
�zChromeCommandTest.test_open_newc C r, �N�open_new_tabr/ r0 r r
r
r
�test_open_new_tabZ r2 z#ChromeCommandTest.test_open_new_tabN)
r r r r3 ZChromer r1 r? rD rH r
r
r
r
r8 G � r8 c @ r7 )
�MozillaCommandTestc C r, r- r0 r r
r
r
r1 d r2 zMozillaCommandTest.test_openc C r9 r: r= r r
r
r
r? i r@ z1MozillaCommandTest.test_open_with_autoraise_falsec C � | j dg dtgd� d S )NrC z-new-windowr/ r0 r r
r
r
rD n �
�z MozillaCommandTest.test_open_newc C rK )NrG z-new-tabr/ r0 r r
r
r
rH s rL z$MozillaCommandTest.test_open_new_tabN)
r r r r3 ZMozillar r1 r? rD rH r
r
r
r
rJ ` rI rJ c @ r7 )
�NetscapeCommandTestc C � | j dddgd�t�gd� d S )Nr. �-raise�-remote�openURL({})r/ �r( �formatr) r r
r
r
r1 } �
�zNetscapeCommandTest.test_openc C s( | j dtdd�ddgd�t�gd� d S )Nr. Fr; �-noraiserP rQ r<