Source code for tests.30_libs.040_PySourceInfo.getCallerFunc.CallCase
"""Check defaults.
"""
from __future__ import absolute_import
import unittest
import os
import pysourceinfo.PySourceInfo
#
#######################
#
[docs]class CallUnits(unittest.TestCase):
[docs] def testCase000(self):
import sys
_s=sys.path[:]
sys.path.insert(0,os.path.dirname(__file__)+os.sep+'..')
import PySourceInfo_check_tests #@UnresolvedImport
fx = PySourceInfo_check_tests.check_callback(pysourceinfo.PySourceInfo.getCallerFuncName,0)
[ sys.path.pop() for x in range(len(sys.path)) ] #@UnusedVariable
sys.path.extend(_s)
assert fx == 'getCallerFuncName'
[docs] def testCase001(self):
import sys
_s=sys.path[:]
sys.path.insert(0,os.path.dirname(__file__)+os.sep+'..')
import PySourceInfo_check_tests #@UnresolvedImport
fx = PySourceInfo_check_tests.check_callback(pysourceinfo.PySourceInfo.getCallerFuncName,1)
[ sys.path.pop() for x in range(len(sys.path)) ] #@UnusedVariable
sys.path.extend(_s)
assert fx == 'check_callback'
[docs] def testCase002(self):
import sys
_s=sys.path[:]
sys.path.insert(0,os.path.dirname(__file__)+os.sep+'..')
import PySourceInfo_check_tests #@UnresolvedImport
fx = PySourceInfo_check_tests.check_callback(pysourceinfo.PySourceInfo.getCallerFuncName,2)
[ sys.path.pop() for x in range(len(sys.path)) ] #@UnusedVariable
sys.path.extend(_s)
assert fx == 'testCase002'
[docs] def testCase003(self):
import sys
_s=sys.path[:]
sys.path.insert(0,os.path.dirname(__file__)+os.sep+'..')
import PySourceInfo_check_tests #@UnresolvedImport
fx = PySourceInfo_check_tests.check_callback(pysourceinfo.PySourceInfo.getCallerFuncName,3)
[ sys.path.pop() for x in range(len(sys.path)) ] #@UnusedVariable
sys.path.extend(_s)
assert fx == 'run'
if __name__ == '__main__':
unittest.main()