관리-도구
편집 파일: test_result.cpython-311.pyc
� �܋f� � � � d dl Z d dlZd dlZd dlZd dlmZ d dlmZ d dlm Z G d� dej � � Z G d� de� � ZdS ) � N)� TAPTestResult)�TestCase)�Trackerc �: � e Zd Zd� Zej d� � � Zd� ZdS )�FakeTestCasec � � d S �N� )�selfs �f/builddir/build/BUILD/cloudlinux-venv-1.0.6/venv/lib/python3.11/site-packages/tap/tests/test_result.py�runTestzFakeTestCase.runTest � � ��� c / � K � t j � | t � � i � � | _ d V � d | _ d S # d | _ w xY wr )�unittest�case�_SubTest�object�_subtest)r �args�kwargss r �subTestzFakeTestCase.subTest sQ � � � � !�$�M�2�2�4����2�F�F�D�M��E�E�E� �D�M�M�M��D�D�M� � � � s �6A � Ac � � d S r r �r �results r �__call__zFakeTestCase.__call__ r r N)�__name__� __module__�__qualname__r � contextlib�contextmanagerr r r r r r r sQ � � � � � � � � � ��!� !� ��!� � � � � r r c �T � e Zd Zed� � � Zd� Zd� Zd� Zd� Zd� Z d� Z d� Zd � Zd S )�TestTAPTestResultc � � t t j d� � }t |dd� � }t � � |_ |S )N�wFr )�open�os�devnullr r �tracker)�cls�streamr s r � _make_onezTestTAPTestResult._make_one s6 � � �b�j�#�&�&���v�u�a�0�0�� ������ r c � � | � � � }t � � }d |_ |� t � � d |d f� � | � t |j j d � � d� � d S �Nr � ) r, � Exception� __cause__�addErrorr �assertEqual�lenr) �_test_cases�r r �exs r �test_adds_errorz!TestTAPTestResult.test_adds_error$ sp � ����!�!�� �[�[������������r�4�(8�9�9�9�����V�^�7��G�H�H�!�L�L�L�L�Lr c � � | � � � }t � � }d |_ |� t � � d |d f� � | � t |j j d � � d� � d S r. ) r, r0 r1 � addFailurer r3 r4 r) r5 r6 s r �test_adds_failurez#TestTAPTestResult.test_adds_failure- sr � ����!�!�� �[�[��������,�.�.�4��T�*:�;�;�;�����V�^�7��G�H�H�!�L�L�L�L�Lr c �� � | � � � }|� t � � � � | � t |j j d � � d� � d S r. )r, � addSuccessr r3 r4 r) r5 r s r �test_adds_successz#TestTAPTestResult.test_adds_success6 sW � ����!�!�����,�.�.�)�)�)�����V�^�7��G�H�H�!�L�L�L�L�Lr c �� � | � � � }|� t � � d� � | � t |j j d � � d� � d S )Nza reasonr r/ )r, �addSkipr r3 r4 r) r5 r s r �test_adds_skipz TestTAPTestResult.test_adds_skip; sW � ����!�!�����|�~�~�z�2�2�2�����V�^�7��G�H�H�!�L�L�L�L�Lr c �n � | j � � � }| � � � }|� t � � |� � |j j d d }| � |j � � | � |j j d� d� � � � d S )Nr r �TODO {}z(expected failure)) �factory�make_excr, �addExpectedFailurer r) r5 �assertFalse�okr3 � directive�text�format)r �excr �lines r �test_adds_expected_failurez,TestTAPTestResult.test_adds_expected_failure@ s� � ��l�#�#�%�%�����!�!���!�!�,�.�.�#�6�6�6��~�)�.�9�!�<�������!�!�!������,�i�.>�.>�?S�.T�.T�U�U�U�U�Ur c �: � | � � � }|� t � � � � |j j d d }| � |j � � | � |j j d� d� � � � d S )Nr r rC z(unexpected success))r, �addUnexpectedSuccessr r) r5 � assertTruerH r3 rI rJ rK )r r rM s r �test_adds_unexpected_successz.TestTAPTestResult.test_adds_unexpected_successH s� � ����!�!���#�#�L�N�N�3�3�3��~�)�.�9�!�<������� � � ������,�i�.>�.>�?U�.V�.V�W�W�W�W�Wr c �> � | � � � }t � � }|� � � 5 |� ||j d� � ddd� � n# 1 swxY w Y |j j d d }| � |j � � dS )z5Test that the runner handles subtest success results.Nr r ) r, r r � addSubTestr r) r5 rQ rH )r r �testrM s r �test_adds_subtest_successz+TestTAPTestResult.test_adds_subtest_successO s� � ����!�!���~�~�� �\�\�^�^� 9� 9����d�D�M�4�8�8�8� 9� 9� 9� 9� 9� 9� 9� 9� 9� 9� 9���� 9� 9� 9� 9��~�)�.�9�!�<������� � � � � s �A � A$�'A$c �x � | � � � }t � � }d|_ t � � }|� � � 5 |� ||j |j |df� � ddd� � n# 1 swxY w Y |j j d d }| � |j � � dS )z5Test that the runner handles subtest failure results.Nr r )r, r0 r1 r r rT r � __class__r) r5 rG rH )r r r7 rU rM s r �test_adds_subtest_failurez+TestTAPTestResult.test_adds_subtest_failureX s� � ����!�!�� �[�[������~�~�� �\�\�^�^� M� M����d�D�M�B�L�"�d�3K�L�L�L� M� M� M� M� M� M� M� M� M� M� M���� M� M� M� M��~�)�.�9�!�<�������!�!�!�!�!s �%A=�=B�BN) r r r �classmethodr, r8 r; r>