HOME


Mini Shell 1.0
DIR: /usr/lib/python3/dist-packages/twisted/trial/test/__pycache__/
Upload File :
Current File : //usr/lib/python3/dist-packages/twisted/trial/test/__pycache__/packages.cpython-312.pyc
�

Ϫ�f+���dZddlZddlZddlmZddlmZdZejdd�Z
dZd	ZGd
�dej�ZGd�d
e�Zy)zf
Classes and functions used by L{twisted.trial.test.test_util}
and L{twisted.trial.test.test_loader}.
�N)�invalidate_caches)�unittestzv
from twisted.trial import unittest

class FooTest(unittest.SynchronousTestCase):
    def testFoo(self):
        pass
�
z
a�
'''This module is used by test_loader to test the Trial test loading
functionality. Do NOT change the number of tests in this module.
Do NOT change the names the tests in this module.
'''

import unittest as pyunit
from twisted.trial import unittest

class FooTest(unittest.SynchronousTestCase):
    def test_foo(self):
        pass

    def test_bar(self):
        pass


class PyunitTest(pyunit.TestCase):
    def test_foo(self):
        pass

    def test_bar(self):
        pass


class NotATest:
    def test_foo(self):
        pass


class AlphabetTest(unittest.SynchronousTestCase):
    def test_a(self):
        pass

    def test_b(self):
        pass

    def test_c(self):
        pass
az
'''This module is used by test_loader to test the Trial test loading
functionality. Do NOT change the number of tests in this module.
Do NOT change the names the tests in this module.
'''

from twisted.trial import unittest

class X:

    def test_foo(self):
        pass

class A(unittest.SynchronousTestCase, X):
    pass

class B(unittest.SynchronousTestCase, X):
    pass

c�v�eZdZddddddddd	d
efddefd
defddefddefgZd�Zd�Z	d�Z
dd�Zd�Zdd�Z
d�Zy)�PackageTest)zbadpackage/__init__.py�frotz
)zbadpackage/test_module.py�)zunimportablepackage/__init__.pyr	)z"unimportablepackage/test_module.pyzimport notarealmoduleok
)zpackage2/__init__.pyr	)zpackage2/test_module.pyz
import frotz
)zpackage/__init__.pyr	)zpackage/frotz.pyr)zpackage/test_bad_module.pyz%raise ZeroDivisionError("fake error")zpackage/test_dos_module.py)zpackage/test_import_module.pyzimport frotzzpackage/test_module.py)zgoodpackage/__init__.pyr	zgoodpackage/test_sample.py)zgoodpackage/sub/__init__.pyr	zgoodpackage/sub/test_sample.py)zinheritancepackage/__init__.pyr	zinheritancepackage/test_x.pyc��tjj|�d}|jd�}|ddk(r|dd}dj	|�S)Nr�/����__init__�.)�os�path�splitext�split�join)�self�filename�name�segss    �=/usr/lib/python3/dist-packages/twisted/trial/test/packages.py�
_toModuleNamezPackageTest._toModuleNametsM���w�w����)�!�,���z�z�#�����8�z�!����9�D��x�x��~��c�j�|jD��cgc]\}}|j|���c}}Scc}}w)zQ
        Return matching module names for files listed in C{self.files}.
        )�filesr)rr�codes   r�
getModuleszPackageTest.getModules{s.��FJ�Z�Z�P�1A�(�D��"�"�8�,�P�P��Ps�/c��|j�}|j�|j�|D]}	tj|=�y#t
$rY�#wxYw�N)r�sort�reverse�sys�modules�KeyError)rr$�modules   r�cleanUpModuleszPackageTest.cleanUpModules�sU���/�/�#�����������	�F�
��K�K��'�	���
��
�s�A�	A�Ac���|jD]\\}}tjj||�}|j	|�t|d�5}|j
|�ddd��^y#1swY�ixYw)N�w)rrrr�_createDirectory�open�write)rr�	parentDirr�contents�fds      r�createFileszPackageTest.createFiles�sn��"&�*�*�	#��H�h��w�w�|�|�I�x�8�H��!�!�(�+��h��$�
#������"�
#�
#�	#�
#�
#�s�A-�-A6	c��tjj|�}tjj|�stj|�yyr )rr�dirname�exists�makedirs)rr�	directorys   rr*zPackageTest._createDirectory�s5���G�G�O�O�H�-�	��w�w�~�~�i�(��K�K�	�"�)rNc��t�|�|j�}||_|j|j|�yr )�invalidateImportCaches�mktemp�parentr0r)rr-s  r�setUpzPackageTest.setUp�s4��� ������
�I����������Y�/rc�$�|j�yr )r'�rs r�tearDownzPackageTest.tearDown�s�����r)rr )�__name__�
__module__�__qualname__�	dosModule�
testModule�
testSample�testInheritanceSamplerrrr'r0r*r:r=�rrrr^s}��-�)�/�K�$�5�#�'�O�	%�y�1�9�	!�:�.�'�	%�z�2�+�	)�:�6�.�	'�)>�?�%
�E�*�Q��#�#�
0�rrc� �eZdZdd�Zd�Zd�Zy)�SysPathManglingTestNc�H�t�tjdd|_tjdd|_|�|j�}tj||�|jj|j�|j|j�yr )r7r#r�oldPath�newPathr8rr:�appendr9�
mangleSysPath)rr9s  rr:zSysPathManglingTest.setUp�sn��� ��x�x��{����x�x��{����>��[�[�]�F����$��'������D�K�K�(����4�<�<�(rc�d�tj|�|j|j�yr )rr=rLrIr<s rr=zSysPathManglingTest.tearDown�s"�����T�"����4�<�<�(rc�*�|tjddyr )r#r)r�pathVars  rrLz!SysPathManglingTest.mangleSysPath�s�������rr )r>r?r@r:r=rLrErrrGrG�s��)�)�rrG)�__doc__rr#�	importlibrr7�
twisted.trialrrB�replacerArCrD�SynchronousTestCaserrGrErr�<module>rUsg��
�
�
�B�"��
�
���t�V�,�	�'�
�R��,A�(�.�.�A�H�+�r