관리-도구
편집 파일: test_parser.cpython-311.pyc
� �܋f�@ � �� � d dl mZ d dlZd dlmZmZ d dlZd dlZd dlZd dlm Z d dl mZ d dlZd dl mZ dZn # e$ r dZY nw xY wed � � � Z G d � dej � � ZdS )� )�contextmanagerN)�BytesIO�StringIO)�mock)�Parser)�peekableTFc # � K � t j d dk rt � � t � � }} nt � � t � � }} t j t j }} | |ct _ t _ t j t j fV � ||ct _ t _ d S # ||ct _ t _ w xY w)Nr � )�sys�version_infor r �stdout�stderr)�new_out�new_err�old_out�old_errs �f/builddir/build/BUILD/cloudlinux-venv-1.0.6/venv/lib/python3.11/site-packages/tap/tests/test_parser.py�captured_outputr s� � � � � ����Q���"�9�9�g�i�i����#�:�:�x�z�z����z�3�:�W�G�2�!(�'��� �C�J��j�#�*�$�$�$�$�!(�'��� �C�J�J�J���'��� �C�J�1�1�1�1s �+3B9 �9Cc �� � e Zd ZdZd� Zd� Zd� Zd� Zd� Zd� Z d� Z d � Zd � Zd� Z d� Zd � Zd� Zd� Zd� Zd� Zd� Zd� Zd� Zd� Zd� Zd� Zd� Zd� Zd� Zd� Z ej d e d� � � � d� � � Z!dS ) � TestParserzTests for tap.parser.Parserc �� � t � � }|� d� � }| � d|j � � | � |j � � | � |j du � � dS )zThe parser extracts an ok line.z!ok - This is a passing test line.�testN)r � parse_line�assertEqual�category� assertTrue�ok�number��self�parser�lines r � test_finds_okzTestParser.test_finds_ok% sj � ������ � �!D�E�E��������/�/�/������ � � ������t�+�,�,�,�,�,� c � � t � � }|� d� � }| � d|j � � | � d|j � � dS )z"The parser extracts a test number.zok 42 is the magic number.r �* N)r r r r r r s r �test_finds_numberzTestParser.test_finds_number/ sU � ������ � �!=�>�>��������/�/�/�����T�[�)�)�)�)�)r$ c � � t � � }|� d� � }| � d|j � � | � d|j � � d S )Nzok 42 A passing test.r zA passing test.�r r r r �descriptionr s r �test_finds_descriptionz!TestParser.test_finds_description8 sW � ������ � �!8�9�9��������/�/�/����*�D�,<�=�=�=�=�=r$ c � � t � � }|� d� � }| � d|j � � | � d|j � � d S )Nz+ok A description # Not part of description.r z A descriptionr) r s r �"test_after_hash_is_not_descriptionz-TestParser.test_after_hash_is_not_description@ sV � ������ � �!N�O�O��������/�/�/�����$�*:�;�;�;�;�;r$ c � � t � � }|� d� � }| � d|j � � | � |j � � d S )Nz ok A description # TODO Not doner )r r r r r �todor s r �test_finds_todozTestParser.test_finds_todoH sQ � ������ � �!C�D�D��������/�/�/����� �"�"�"�"�"r$ c � � t � � }|� d� � }| � d|j � � | � |j � � d S )Nzok A description # SKIP for nowr �r r r r r �skipr s r �test_finds_skipzTestParser.test_finds_skipP sQ � ������ � �!B�C�C��������/�/�/����� �"�"�"�"�"r$ c �. � t � � }|� d� � }| � d|j � � | � |j � � | � |j du � � | � d|j j � � dS )z"The parser extracts a not ok line.z%not ok - This is a failing test line.r N� ) r r r r �assertFalser r r � directive�textr s r �test_finds_not_okzTestParser.test_finds_not_okX s� � ������ � �!H�I�I��������/�/�/������!�!�!������t�+�,�,�,�����T�^�0�1�1�1�1�1r$ c �h � t � � }d}|� |� � }|j }| � d|j � � | � d|j � � | � |j � � | � |j � � | � d|j � � dS )zThe parser extracts a directivez/not ok - This line fails # TODO not implementedr zTODO not implementedznot implementedN)r r r8 r r r9 r7 r3 r r/ �reason)r r! � test_liner"