î
É X€  ã               @   sý   d  Z  d d l Z d d l Z d d l Z d d l Z d d l Z d d l Z d d l m Z d d l	 m
 Z
 d d l m Z d d l m Z d d l m Z d Z d	 Z e j d k  rË e j d ƒ Z n  e j d ƒ Z d Z Gd d „  d e j ƒ Z d S)zdevelop tests
é    N)ÚDistutilsError)ÚStringIO)Útest)Úeasy_install)ÚDistributionzºfrom setuptools import setup

setup(name='foo',
    packages=['name', 'name.space', 'name.space.tests'],
    namespace_packages=['name'],
    test_suite='name.space.tests.test_suite',
)
uò   # -*- coding: Latin-1 -*-
# SÃ¶me ArbitrÃ¤ry Ãœnicode to test IssÃ¼Ã© 310
try:
    __import__('pkg_resources').declare_namespace(__name__)
except ImportError:
    from pkgutil import extend_path
    __path__ = extend_path(__path__, __name__)
é   zUTF-8zLatin-1z½import unittest

class TestTest(unittest.TestCase):
    def test_test(self):
        print "Foo" # Should fail under Python 3 unless 2to3 is used

test_suite = unittest.makeSuite(TestTest)
c               @   s4   e  Z d  Z d d „  Z d d „  Z d d „  Z d S)ÚTestTestTestc             C   sú  t  j d k  s t t  d ƒ r" d  St j ƒ  |  _ t j t j j	 |  j d ƒ ƒ t j t j j	 |  j d d ƒ ƒ t j t j j	 |  j d d d ƒ ƒ t j j	 |  j d ƒ } t
 | d ƒ } | j t ƒ | j ƒ  t j ƒ  |  _ t j j	 |  j d d ƒ } t
 | d	 ƒ } | j t ƒ | j ƒ  t j j	 |  j d d d ƒ } t
 | d ƒ } | j d
 ƒ | j ƒ  t j j	 |  j d d d d ƒ } t
 | d ƒ } | j t ƒ | j ƒ  t j |  j ƒ t j |  _ t j ƒ  t _ t j |  _ t j ƒ  t _ d  S)Nz2.6Úreal_prefixÚnameÚspaceÚtestszsetup.pyZwtz__init__.pyÚwbz#empty
)ÚsysÚversionÚhasattrÚtempfileÚmkdtempÚdirÚosÚmkdirÚpathÚjoinÚopenÚwriteÚSETUP_PYÚcloseÚgetcwdÚold_cwdÚNS_INITÚTEST_PYÚchdirÚsiteÚ	USER_BASEÚold_baseÚ	USER_SITEÚold_site)ÚselfÚsetupÚfÚinit© r*   úL/home/ubuntu/projects/ifolica/build/setuptools/setuptools/tests/test_test.pyÚsetUp4   s8    "%


!
zTestTestTest.setUpc             C   s~   t  j d k  s t t  d ƒ r" d  St j |  j ƒ t j |  j ƒ t j t	 j
 ƒ t j t	 j ƒ |  j t	 _
 |  j t	 _ d  S)Nz2.6r	   )r   r   r   r   r    r   ÚshutilÚrmtreer   r!   r"   r$   r#   r%   )r&   r*   r*   r+   ÚtearDownY   s    zTestTestTest.tearDownc             C   så   t  j d k  s t t  d ƒ r" d  St t d d d d d d g d d g d	 d
 d d ƒ ƒ } d | _ t | ƒ } d | _ | j ƒ  t	 j
 | _ d | _ t  j } t ƒ  t  _ z' y | j ƒ  Wn t k
 rÒ Yn XWd  | t  _ Xd  S)Nz2.6r	   r
   ZfooÚpackagesz
name.spacezname.space.testsZnamespace_packagesZ
test_suitezname.space.tests.test_suiteZuse_2to3Tzsetup.pyé   )r   r   r   r   ÚdictÚscript_namer   ÚuserÚensure_finalizedr!   r$   Úinstall_dirÚstdoutr   ÚrunÚ
SystemExit)r&   ÚdistÚcmdZ
old_stdoutr*   r*   r+   Ú	test_testd   s,    				
			zTestTestTest.test_testN)Ú__name__Ú
__module__Ú__qualname__r,   r/   r<   r*   r*   r*   r+   r   2   s   %r   )r   )Ú__doc__r   r-   r!   r   r   ZunittestÚdistutils.errorsr   Zsetuptools.compatr   Zsetuptools.command.testr   Zsetuptools.commandr   Zeasy_install_pkgZsetuptools.distr   r   r   Úversion_infoÚdecodeÚencoder   ZTestCaser   r*   r*   r*   r+   Ú<module>   s$   
		