Your IP : 216.73.216.196
B
.��V� � @ sH d dl Z d dlZd dlmZ d dlmZ d dlmZ G dd� de�Z dS )� N)�Adapter)�Parser)�Rulesc @ sL e Zd ZdZeddg�Zdd� Zdd� Zdd � Zd
d� Z dd
� Z
dd� ZdS )�Loaderz*Load TAP lines into unittest-able objects.�
diagnostic�unknownc C s t � | _d S )N)r �_parser)�self� r
�;/opt/alt/python37/lib/python3.7/site-packages/tap/loader.py�__init__ s zLoader.__init__c C sD t �� }x6|D ].}tj�|�r,| �||� q|�| �|�� qW |S )z�Load any files found into a suite.
Any directories are walked and their files are added as TAP files.
:returns: A ``unittest.TestSuite`` instance
)�unittest� TestSuite�os�path�isdir�_find_tests_in_directory�addTest�load_suite_from_file)r �files�suite�filepathr
r
r �load s
zLoader.loadc C sF t �� }t||�}tj�|�s*|�� |S | j�|�}| � ||||�S )z{Load a test suite with test lines from the provided TAP file.
:returns: A ``unittest.TestSuite`` instance
)
r
r r r r �existsZhandle_file_does_not_existr �
parse_file�_load_lines)r �filenamer �rules�line_generatorr
r
r r "