HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux spn-python 5.15.0-89-generic #99-Ubuntu SMP Mon Oct 30 20:42:41 UTC 2023 x86_64
User: arjun (1000)
PHP: 8.1.2-1ubuntu2.20
Disabled: NONE
Upload Files
File: //usr/lib/python3/dist-packages/twisted/trial/test/__pycache__/test_output.cpython-310.pyc
o

�b��@s^dZddlZddlmZddlmZddlmZddlm	Z	dZ
dd	�ZGd
d�de	j�Z
dS)z*
Tests for the output generated by trial.
�N)�StringIO)�trial)�runner)�packageszNo module named 'frotz'cGsVddlm}t��}|�|�t�}tj|j||dd�}t�	|�}|�
|�|��S)Nr)�reporterztemp-directory)�stream�workingDirectory)�
twisted.trialrr�Options�parseOptionsrr�TrialRunner�VerboseTextReporter�	_getSuite�run�getvalue)�argsr�config�output�myRunner�suite�r�@/usr/lib/python3/dist-packages/twisted/trial/test/test_output.py�runTrials
�

rcs�eZdZdZdd�ZdZdd�Zdd�Z�fd	d
�Z�fdd�Z	d
d�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�Z�ZS))�ImportErrorsTestszbActually run trial as if on the command line and check that the output
    is what we expect.
    cCsdS�Nr��selfrrr�debug(szImportErrorsTests.debug�_testImportErrorscGstd|��g|�R�S)Nz--temp-directory)r�mktemp)rrrrrr-szImportErrorsTests.runTrialcCst|�|Sr)�print)r�stuffrrr�_print0szImportErrorsTests._printc� t�j||g|�Ri|��|Sr)�super�assertIn�r�	container�	containeer�kwargs��	__class__rrr%4�zImportErrorsTests.assertIncr#r)r$�assertNotInr&r*rrr-9r,zImportErrorsTests.assertNotIncCs|��dSr)rrrrr�
test_trialRun>szImportErrorsTests.test_trialRuncCs&|�d�}|�|d�|�|d�|S)Nztwisted.doesntexist�[ERROR]�rr%�r�drrr�test_nonexistentModuleAs
z(ImportErrorsTests.test_nonexistentModulecC�2|�d�}|�|d�|�|d�|�|d�|S)N�doesntexist�ModuleNotFoundr/r0r1rrr�test_nonexistentPackageG�

z)ImportErrorsTests.test_nonexistentPackagecCr4)Nzdoesntexist.barney�ObjectNotFoundr/r0r1rrr�!test_nonexistentPackageWithModuleNr8z3ImportErrorsTests.test_nonexistentPackageWithModulecC�2|�d�}|�|d�|�|d�|�|d�|S)N�
badpackager/�IOError�rr%r-r1rrr�test_badpackageUr8z!ImportErrorsTests.test_badpackagecCr;)Nzbadpackage.test_moduler/r=r>r1rrr�test_moduleInBadpackage\r8z)ImportErrorsTests.test_moduleInBadpackagecC�>|�d�}|�|d�|�|d�|�|d�|�|d�|S)Nzpackage.test_bad_moduler/r=�<module r>r1rrr�test_badmodulec�
z ImportErrorsTests.test_badmodulecCrA)Nzpackage.test_import_moduler/r=rBr>r1rrr�test_badimportkrDz ImportErrorsTests.test_badimportcCsJ|�d�}|�|d�|�|d�|�|d�|�|d�|�|d�|S)N�packager/�test_bad_module�test_import_modulerBr=r>r1rrr�test_recurseImportss
z$ImportErrorsTests.test_recurseImportcCsV|�d�}|�|d�|�|d�|�|d�|�|t�|�|d�|�|d�|S)N�package2r/�test_modulerBr=�rr%�_noModuleErrorr-r1rrr�test_recurseImportErrors|s
z*ImportErrorsTests.test_recurseImportErrorscCs4|�dd�}|�|d�|�|t�|�|d�|S)Nz-NrJr/rBrLr1rrr�test_nonRecurseImportErrors�s
z-ImportErrorsTests.test_nonRecurseImportErrorscCs>|�d�}|�|d�|�|d�|�|d�|�|d�|S)Nzpackage.test_moduler/r=�OK�PASSED (successes=1))rr-r%r1rrr�test_regularRun�rDz!ImportErrorsTests.test_regularRuncC�X|�|j�|�tj�|jdd��}|�|d�|�|d�|�|d�|�|d�|S)NrFztest_module.pyr/r=rPrQ�	�
mangleSysPath�oldPathr�os�path�join�parentr-r%r1rrr�
test_filename�szImportErrorsTests.test_filenamecCrS)NrFztest_dos_module.pyr/r=rPrQrTr1rrr�test_dosFile�szImportErrorsTests.test_dosFile)�__name__�
__module__�__qualname__�__doc__rrZrr"r%r-r.r3r7r:r?r@rCrErIrNrOrRr[r\�
__classcell__rrr*rr#s,	
	r)r`rW�ior�twisted.scriptsrr	r�twisted.trial.testrrMr�SysPathManglingTestrrrrr�<module>s