Current File : //usr/local/apps/python3/lib/python3.11/test/__pycache__/test_webbrowser.cpython-311.pyc |
�
�Ke�* � � � d dl Z d dlZd dlZd dlZd dlZd dlmZ d dlmZ d dlm Z d dlm
Z
ej s ej d� � �dZ
dZ G d � d
ej � � Z G d� d� � Z G d
� deej � � Z G d� deej � � Z G d� deej � � Z G d� deej � � Z G d� deej � � Z G d� deej � � Z G d� deej � � Z G d� deej � � Z G d� dej � � Z G d� d ej � � Zed!k r ej � � dS dS )"� N)�mock)�support)�
import_helper)� os_helperz"test webserver requires subprocesszhttp://www.example.com�testc � � e Zd Zd� Zdd�ZdS )� PopenMockc � � dS �Nr � ��selfs �>/usr/local/apps/python3/lib/python3.11/test/test_webbrowser.py�pollzPopenMock.poll � � ��q� Nc � � dS r r )r �secondss r �waitzPopenMock.wait r r �N)�__name__�
__module__�__qualname__r r r r r r r s7 � � � � � �� � �� � � � � r r c � � e Zd Zegi d�d�ZdS )�CommandTestMixin)�args�kwc � � t � � }t j | t d|� � | � t
�� � } t
||� � |i |�� t j j d d }| � |d t
� � |�
d� � |D ]@} | � | |� � |�
|� | � � � � �A| � ||� � 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 �patch�
subprocess�
browser_class�CMD_NAME�getattrr � call_args�assertEqual�pop�assertIn�index)
r �methr r �options� arguments�popen�browser�
popen_args�options
r �_testzCommandTestMixin._test s� � � �����
�d�J���7�7�7��$�$�(�$�3�3���������+��+�+�+��%�/��2�1�5�
�����A���1�1�1����q����� 5� 5�F��M�M�&�*�-�-�-��N�N�:�+�+�F�3�3�4�4�4�4�����Y�/�/�/�/�/r N)r r r �URLr2 r r r r r s4 � � � � � �#&�%�B� 0� 0� 0� 0� 0� 0� 0r r c �"