本文整理匯總了Python中PySourceInfo_check_tests類的典型用法代碼示例。如果您正苦於以下問題:Python PySourceInfo_check_tests類的具體用法?Python PySourceInfo_check_tests怎麽用?Python PySourceInfo_check_tests使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
在下文中一共展示了PySourceInfo_check_tests類的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: testCase003
def testCase003(self):
import sys
_s=sys.path[:]
sys.path.insert(0,os.path.dirname(__file__)+os.sep+'..')
import PySourceInfo_check_tests #@UnresolvedImport
version = '{0}.{1}'.format(*sys.version_info[:2])
if version == '2.6': # pragma: no cover
b = os.path.basename(unittest.__file__)[:-4]
a = PySourceInfo_check_tests.check_callback(pysourceinfo.PySourceInfo.getCallerModuleName,3)
elif version == '2.7': # pragma: no cover
fpn = os.path.dirname(unittest.__file__)
fpn = os.path.basename(fpn)
fx = PySourceInfo_check_tests.check_callback(pysourceinfo.PySourceInfo.getCallerModulePythonPath,3)
a = os.path.normpath(fx+os.sep+fpn)
b = os.path.normpath(os.path.dirname(unittest.__file__))
else:
assert False
[ sys.path.pop() for x in range(len(sys.path)) ] #@UnusedVariable
sys.path.extend(_s)
assert a == b
示例2: testCase002
def testCase002(self):
import sys
_s=sys.path[:]
_sx = repr(sys.path)
sys.path.insert(0,os.path.dirname(__file__)+os.sep+'..')
import PySourceInfo_check_tests #@UnresolvedImport
fx0 = os.path.dirname(PySourceInfo_check_tests.__file__)+os.sep+".."+os.sep+".."+os.sep+".."
fx1 = os.path.dirname(PySourceInfo_check_tests.__file__)+os.sep+".."+os.sep+".."
fx2 = os.path.dirname(pysourceinfo.__file__)+os.sep+".."
fx = PySourceInfo_check_tests.check_callback(pysourceinfo.PySourceInfo.getCallerPackagePythonPath,2)
fx0 = os.path.abspath(fx0)
fx1 = os.path.abspath(fx1)
fx2 = os.path.abspath(fx2)
fx = os.path.abspath(fx)
fx0 = os.path.normpath(fx0)
fx1 = os.path.normpath(fx1)
fx2 = os.path.normpath(fx2)
fx = os.path.normpath(fx)
assert fx == fx0 or fx == fx1
assert _sx != repr(sys.path)
sys.path.pop(0)
assert _sx == repr(sys.path)
[ sys.path.pop() for x in range(len(sys.path)) ] #@UnusedVariable
sys.path.extend(_s)
示例3: testCase001
def testCase001(self):
import sys
_s=sys.path[:]
sys.path.insert(0,os.path.dirname(__file__)+os.sep+'..')
import PySourceInfo_check_tests #@UnresolvedImport
fx0 = "PySourceInfo_check_tests.py"
fx1 = "tests/30_libs/040_PySourceInfo/PySourceInfo_check_tests.py"
fx = PySourceInfo_check_tests.check_callback(pysourceinfo.PySourceInfo.getCallerModuleFilePathName,1)
fx0 = os.path.normpath(fx0)
fx = os.path.normpath(fx)
fx0 = os.path.normpath(fx0)
fx1 = os.path.normpath(fx1)
fx = os.path.abspath(fx)
fx = os.path.normpath(fx)
fx = pysourceinfo.PySourceInfo.getPythonPathRel(fx)
assert fx == fx0 or fx == fx1
[ sys.path.pop() for x in range(len(sys.path)) ] #@UnusedVariable
sys.path.extend(_s)
示例4: testCase000
def testCase000(self):
import sys
_s=sys.path[:]
sys.path.insert(0,os.path.dirname(__file__)+os.sep+'..')
import PySourceInfo_check_tests #@UnresolvedImport
fpn = pysourceinfo.PySourceInfo.getModulePathName(pysourceinfo.PySourceInfo)
fx = PySourceInfo_check_tests.check_callback(pysourceinfo.PySourceInfo.getCallerPathName,0)
assert os.path.normpath(fx) == fpn
[ sys.path.pop() for x in range(len(sys.path)) ] #@UnusedVariable
sys.path.extend(_s)