�
Ϫ�f+ � � � d Z ddlZddlZddlmZ ddlmZ dZej dd� Z
dZd Z G d
� dej � Z G d� 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 � e Zd Zddddddddd d
efddefd
defddefddefgZd� Zd� Z d� Z
dd�Zd� Zdd�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.pyzimport 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 � � t j j |� d }|j d� }|d dk( r|d d }dj |� S )Nr �/����__init__�.)�os�path�splitext�split�join)�self�filename�name�segss �=/usr/lib/python3/dist-packages/twisted/trial/test/packages.py�
_toModuleNamezPackageTest._toModuleNamet sM � ��w�w����)�!�,���z�z�#�����8�z�!����9�D��x�x��~�� c �j � | j D ��cg c] \ }}| j |� �� c}}S c c}}w )zQ
Return matching module names for files listed in C{self.files}.
)�filesr )r r �codes r �
getModuleszPackageTest.getModules{ s. � � FJ�Z�Z�P�1A�(�D��"�"�8�,�P�P��Ps �/c � � | j � }|j � |j � |D ] } t j |= � y # t
$ r Y �#w xY w�N)r �sort�reverse�sys�modules�KeyError)r r$ �modules r �cleanUpModuleszPackageTest.cleanUpModules� sU � ��/�/�#����������� �F�
��K�K��'� �� �
��
�s �A� A�Ac �� � | j D ]\ \ }}t j j ||� }| j |� t |d� 5 }|j
|� d d d � �^ y # 1 sw Y �ixY w)N�w)r r r r �_createDirectory�open�write)r r � parentDirr �contents�fds r �createFileszPackageTest.createFiles� sn � �"&�*�*� #��H�h��w�w�|�|�I�x�8�H��!�!�(�+��h��$�
#������"�
#�
#� #�
#�
#�s �A-�-A6 c � � t j j |� }t j j |� st j |� y y r )r r �dirname�exists�makedirs)r r � directorys r r* zPackageTest._createDirectory� s5 � ��G�G�O�O�H�-� ��w�w�~�~�i�(��K�K� �"� )r Nc � � t � |�| j � }|| _ | j | j |� y r )�invalidateImportCaches�mktemp�parentr0 r )r r- s r �setUpzPackageTest.setUp� s4 � �� ������
�I����������Y�/r c �$ � | j � y r )r' |