def test_getObjectDebug(self):
        color.blue("test here baby")
        

        expected = ['rf', 'sgetSorted']
        linetext = 'await rf.sgetSorted "sqlRegions", defer sqlRegions'
        position = len('await rf.sgetSor')
        actual = navigateToModel.getObject(linetext, position)
        self.assertEqual(actual, expected)    
    def test_getObject(self):
        color.blue("test here baby")
        

        expected = ['ru', 'short790']
        linetext = 'app.get ru.short790, (req, res, next)->'
        position = len('app.get ru.short79')
        actual = navigateToModel.getObject(linetext, position)
        self.assertEqual(actual, expected)
    def test_bigFile(self):
        color.blue("test here baby")
        

        expected = ['assertMy', 'equals']
        
        position = 717

        result = navigateToModel.getObject(inputText, position)

        self.assertEqual(result, expected)
    def test_bigFile(self):
        color.blue("test here baby")
        

        expected = ['', 'startsLikeCodeNumber']
        


        result = navigateToModel.getObject(inputText, positionForBigTest)

        self.assertEqual(result, expected)
    def test_bigFile(self):
        color.blue("test here baby")
        

        expected = ['reactOnCursorPosition', 'starter']
        
        position = 638

        result = navigateToModel.getObject(inputText, position)
        print('result')
        print(repr(result))

        self.assertEqual(result, expected)
    def test_bigFile(self):
        color.blue("test here baby")
        

        expected = ['', 'getObject']
        
        position = 2151

        result = navigateToModel.getObject(inputText, position)

        color.red('result')
        print(repr(result))

        self.assertEqual(result, expected)
예제 #7
0
    def find(self, filename, position):

        text = filer2.read(filename)
        [obj, method] = navigateToModel.getObject(text, position)

        

        mypath = absRel3.folder(filename)
        
        targetFiles = []
        for (dirpath, dirnames, filenames) in walk(mypath):

            targetFiles.extend([ os.path.join(dirpath, f) for f in filenames if absRel3.Ext(f) == 'py'])

        regex = "{}.\(".format(method)
        regex = re.compile(regex)       
        
        returnList = []     
        for f in targetFiles:
            # text = filer2.read(f)
            positions = navigateToModel.getPositions(f, regex)      
            if positions:
                returnList.extend([(f, p) for p in positions])

        
        self.i.setAll(returnList)



        if returnList:
            current = returnList[-1]
            (f,p) = current
            self.i.currentSet("{0}{1}".format(f,p))
            
            count = len(returnList)
            
            status = "{0} of {1}".format(count, count)
            # current.insert(2, status)
            current += (status,)
        else:
            status = "no found"
            current = None  
        return current  
예제 #8
0
	def test_testName(self):
		color.blue("test here baby")

		result = navigateToModel.getObject(text, position)
		print(result)
		self.assertEqual(result, ['', 'eachCodeFromToKey'])
def find(filename, position):
	navigateToModel.getObject()