ó
Öõ‡Mc           @   s   d  d l  Z  d  d l Z d  d l m Z d Z e j d d ƒ Z d Z d Z d e j	 f d	 „  ƒ  YZ
 d
 e
 f d „  ƒ  YZ d S(   iÿÿÿÿN(   t   unittestsk   
from twisted.trial import unittest

class FooTest(unittest.TestCase):
    def testFoo(self):
        pass
s   
s   
s¬  
'''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.TestCase):
    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(object):
    def test_foo(self):
        pass


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

    def test_b(self):
        pass

    def test_c(self):
        pass
sp  
'''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(object):
    
    def test_foo(self):
        pass

class A(unittest.TestCase, X):
    pass

class B(unittest.TestCase, X):
    pass

t   PackageTestc           B   s¡   e  Z d d d d  d! d" d# d e f d$ d e f d% d e f d& d e f d' d e f g Z d „  Z d „  Z d „  Z	 d d „ Z
 d „  Z d( d „ Z d „  Z RS()   s   badpackage/__init__.pys   frotz
s   badpackage/test_module.pyt    s   package2/__init__.pys   package2/test_module.pys   import frotz
s   package/__init__.pys   package/frotz.pys   package/test_bad_module.pys%   raise ZeroDivisionError("fake error")s   package/test_dos_module.pys   package/test_import_module.pys   import frotzs   package/test_module.pys   goodpackage/__init__.pys   goodpackage/test_sample.pys   goodpackage/sub/__init__.pys   goodpackage/sub/test_sample.pys   inheritancepackage/__init__.pys   inheritancepackage/test_x.pyc         C   sO   t  j j | ƒ d } | j d ƒ } | d d k rB | d  } n  d j | ƒ S(   Ni    t   /iÿÿÿÿt   __init__t   .(   t   ost   patht   splitextt   splitt   join(   t   selft   filenamet   namet   segs(    (    s?   /usr/lib/python2.7/dist-packages/twisted/trial/test/packages.pyt   _toModuleNameb   s
    c         C   s   t  |  j t |  j Œ  d ƒ S(   Ni    (   t   mapR   t   zipt   files(   R   (    (    s?   /usr/lib/python2.7/dist-packages/twisted/trial/test/packages.pyt
   getModulesi   s    c         C   sW   |  j  ƒ  } | j ƒ  | j ƒ  x0 | D]( } y t j | =Wq' t k
 rN q' Xq' Wd  S(   N(   R   t   sortt   reverset   syst   modulest   KeyError(   R   R   t   module(    (    s?   /usr/lib/python2.7/dist-packages/twisted/trial/test/packages.pyt   cleanUpModulesl   s    

R   c         C   sf   x_ |  j  D]T \ } } t j j | | ƒ } |  j | ƒ t | d ƒ } | j | ƒ | j ƒ  q
 Wd  S(   Nt   w(   R   R   R   R
   t   _createDirectoryt   opent   writet   close(   R   R   t	   parentDirR   t   contentst   fd(    (    s?   /usr/lib/python2.7/dist-packages/twisted/trial/test/packages.pyt   createFilesv   s    c         C   s8   t  j j | ƒ } t  j j | ƒ s4 t  j | ƒ n  d  S(   N(   R   R   t   dirnamet   existst   makedirs(   R   R   t	   directory(    (    s?   /usr/lib/python2.7/dist-packages/twisted/trial/test/packages.pyR   ~   s    c         C   s;   | d  k r |  j ƒ  } n  | |  _ |  j |  j | ƒ d  S(   N(   t   Nonet   mktempt   parentR#   R   (   R   R    (    (    s?   /usr/lib/python2.7/dist-packages/twisted/trial/test/packages.pyt   setUpƒ   s    	c         C   s   |  j  ƒ  d  S(   N(   R   (   R   (    (    s?   /usr/lib/python2.7/dist-packages/twisted/trial/test/packages.pyt   tearDown‰   s    (   s   badpackage/__init__.pys   frotz
(   s   badpackage/test_module.pyR   (   s   package2/__init__.pyR   (   s   package2/test_module.pys   import frotz
(   s   package/__init__.pyR   (   s   package/frotz.pys   frotz
(   s   package/test_bad_module.pys%   raise ZeroDivisionError("fake error")(   s   package/test_import_module.pys   import frotz(   s   goodpackage/__init__.pyR   (   s   goodpackage/sub/__init__.pyR   (   s   inheritancepackage/__init__.pyR   N(   t   __name__t
   __module__t	   dosModulet
   testModulet
   testSamplet   testInheritanceSampleR   R   R   R   R#   R   R(   R+   R,   (    (    (    s?   /usr/lib/python2.7/dist-packages/twisted/trial/test/packages.pyR   M   s0    							
	t   SysPathManglingTestc           B   s&   e  Z d d  „ Z d „  Z d „  Z RS(   c         C   sl   t  j |  _ t  j |  _ | d  k r5 |  j ƒ  } n  t j |  | ƒ |  j j |  j	 ƒ |  j
 |  j ƒ d  S(   N(   R   R   t   oldPatht   newPathR(   R)   R   R+   t   appendR*   t   mangleSysPath(   R   R*   (    (    s?   /usr/lib/python2.7/dist-packages/twisted/trial/test/packages.pyR+      s    c         C   s!   t  j |  ƒ |  j |  j ƒ d  S(   N(   R   R,   R7   R4   (   R   (    (    s?   /usr/lib/python2.7/dist-packages/twisted/trial/test/packages.pyR,   –   s    c         C   s   | t  j (d  S(   N(   R   R   (   R   t   pathVar(    (    s?   /usr/lib/python2.7/dist-packages/twisted/trial/test/packages.pyR7   š   s    N(   R-   R.   R(   R+   R,   R7   (    (    (    s?   /usr/lib/python2.7/dist-packages/twisted/trial/test/packages.pyR3   Œ   s   		(   R   R   t   twisted.trialR    R0   t   replaceR/   R1   R2   t   TestCaseR   R3   (    (    (    s?   /usr/lib/python2.7/dist-packages/twisted/trial/test/packages.pyt   <module>   s   *?