Your IP : 172.28.240.42


Current Path : /usr/lib/python2.7/dist-packages/twisted/python/test/
Upload File :
Current File : //usr/lib/python2.7/dist-packages/twisted/python/test/modules_helpers.pyc

ó
î6Nc@s\dZddlZddlmZddlmZddlmZdefd„ƒYZdS(sƒ
Facilities for helping test code which interacts with L{twisted.python.modules},
or uses Python's own module system to load code.
iÿÿÿÿN(tTestCase(tmodules(tFilePathtTwistedModulesTestCasecBs5eZeed„Zd„Zd„Zdd„ZRS(cCsHx-|jd|ƒD]}|j|kr|SqW|jd|fƒdS(sï
        You don't ever actually want to do this, so it's not in the public API, but
        sometimes we want to compare the result of an iterative call with a
        lookup call and make sure they're the same for test purposes.
        timportPackagess+Unable to find module %r through iteration.N(twalkModulestnametfail(tselftmodnametwhereRtmodinfo((sG/usr/lib/python2.7/dist-packages/twisted/python/test/modules_helpers.pytfindByIterationscs4tj‰‡fd†}|j|ƒ|tj(dS(sW
        Replace sys.path, for the duration of the test, with the given value.
        csˆtj(dS(N(tsystpath((toriginalSysPath(sG/usr/lib/python2.7/dist-packages/twisted/python/test/modules_helpers.pytcleanUpSysPath"sN(R
Rt
addCleanup(RtsysPathR((RsG/usr/lib/python2.7/dist-packages/twisted/python/test/modules_helpers.pytreplaceSysPaths

csLtjjƒ‰‡fd†}|j|ƒtjjƒtjj|ƒdS(sZ
        Replace sys.modules, for the duration of the test, with the given value.
        cs!tjjƒtjjˆƒdS(N(R
Rtcleartupdate((toriginalSysModules(sG/usr/lib/python2.7/dist-packages/twisted/python/test/modules_helpers.pytcleanUpSysModules-s
N(R
RtcopyRRR(Rt
sysModulesR((RsG/usr/lib/python2.7/dist-packages/twisted/python/test/modules_helpers.pytreplaceSysModules(s


ttest_packagecCsEt|jƒƒ}|jdƒ}|jƒ|jdƒjdƒ|S(s‰
        Generate a L{FilePath} with one package, named C{pkgname}, on it, and
        return the L{FilePath} of the path entry.
        Rs__init__.pyt(Rtmktemptchildtmakedirst
setContent(Rtpkgnametentrytpkg((sG/usr/lib/python2.7/dist-packages/twisted/python/test/modules_helpers.pytpathEntryWithOnePackage5s

(t__name__t
__module__RtFalseRRRR$(((sG/usr/lib/python2.7/dist-packages/twisted/python/test/modules_helpers.pyRs		
(	t__doc__R
ttwisted.trial.unittestRttwisted.pythonRttwisted.python.filepathRR(((sG/usr/lib/python2.7/dist-packages/twisted/python/test/modules_helpers.pyt<module>s