def helper(self, src, classsrc, line, col): try: createPackageStructure(src,classsrc) filename = pkgstructureFile2 refs = [x for x in findReferences(filename,line,col)] finally: removePackageStructure() return refs
def helper(self, src, classsrc, line, col): try: createPackageStructure(src, classsrc) filename = pkgstructureFile2 refs = [x for x in findReferences(filename, line, col)] finally: removePackageStructure() return refs
def helper4(self, src, importedsrc, line, col): createPackageStructure(src, importedsrc) filename = pkgstructureFile1 refs = [ x for x in findReferences(filename, line, col) if x.confidence == 100 ] return refs
def test_returnsOtherFilesInSameNonPackageDirectory(self): try: classsrc = trimLines(""" def testFunction(): print 'hello' """) src = trimLines(""" from baz import testFunction """) writeTmpTestFile(src) newtmpfile = os.path.join(tmproot,"baz.py") writeFile(newtmpfile, classsrc) refs = [x for x in findReferences(newtmpfile,1,4)] assert refs[0].filename == tmpfile assert refs[0].lineno == 1 finally: os.remove(newtmpfile) deleteTmpTestFile()
def test_returnsOtherFilesInSameNonPackageDirectory(self): try: classsrc = trimLines(""" def testFunction(): print 'hello' """) src = trimLines(""" from baz import testFunction """) writeTmpTestFile(src) newtmpfile = os.path.join(tmproot, "baz.py") writeFile(newtmpfile, classsrc) refs = [x for x in findReferences(newtmpfile, 1, 4)] assert refs[0].filename == tmpfile assert refs[0].lineno == 1 finally: os.remove(newtmpfile) deleteTmpTestFile()
def helper4(self, src, importedsrc, line, col): createPackageStructure(src,importedsrc) filename = pkgstructureFile1 refs = [x for x in findReferences(filename,line,col) if x.confidence == 100] return refs
def helper(self,src,lineno,colno): writeTmpTestFile(src) refs = [x for x in findReferences(tmpfile,lineno,colno)] return refs
def findReferences_helper(self, src, lineno, colno): writeTmpTestFile(src) refs = [x for x in findReferences(tmpfile, lineno, colno)] return refs