[Pydev-cvs] org.python.pydev/tests/org/python/pydev/editor/codecompletion/revisited PythonPathHelper
Brought to you by:
fabioz
From: Fabio Z. <fa...@us...> - 2005-02-03 12:31:23
|
Update of /cvsroot/pydev/org.python.pydev/tests/org/python/pydev/editor/codecompletion/revisited In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16984/tests/org/python/pydev/editor/codecompletion/revisited Modified Files: PythonPathHelperTest.java Log Message: more tests to code completion Index: PythonPathHelperTest.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/tests/org/python/pydev/editor/codecompletion/revisited/PythonPathHelperTest.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** PythonPathHelperTest.java 2 Feb 2005 15:56:18 -0000 1.2 --- PythonPathHelperTest.java 3 Feb 2005 12:31:14 -0000 1.3 *************** *** 83,118 **** CompletionState state = new CompletionState(line,col, token, nature); comps = manager.getCompletionsForToken(doc, state); ! assertEquals(3, comps.length); ASTManagerTest.assertIsIn("TestCase", comps); ASTManagerTest.assertIsIn("main", comps); ASTManagerTest.assertIsIn("TestCaseAlias", comps); } - // public void testHierarchy(){ - // token = "Test"; - // line = 6; - // col = 14; - // - // sDoc = ""+ - // "from testlib import unittest \n" + - // " \n" + - // "class Test(unittest.TestCase):\n" + - // " \n" + - // " def a(self): \n" + - // " self. \n"; - // - // Document doc = new Document(sDoc); - // IToken[] comps = null; - // comps = manager.getCompletionsForToken(doc, line, col, token, qual, nature); - // System.out.println("COMPLETIONS ---------------------"); - // for (int i = 0; i < comps.length; i++) { - // System.out.println(comps[i].getRepresentation()); - // } - // System.out.println("END COMPLETIONS ---------------------"); - // assertTrue(comps.length > 5); - // - // } - public void testClassHierarchyCompletion(){ --- 83,96 ---- CompletionState state = new CompletionState(line,col, token, nature); comps = manager.getCompletionsForToken(doc, state); ! assertEquals(6, comps.length); ASTManagerTest.assertIsIn("TestCase", comps); ASTManagerTest.assertIsIn("main", comps); ASTManagerTest.assertIsIn("TestCaseAlias", comps); + ASTManagerTest.assertIsIn("GUITest", comps); + ASTManagerTest.assertIsIn("testcase", comps); + ASTManagerTest.assertIsIn("AnotherTest", comps); } public void testClassHierarchyCompletion(){ *************** *** 135,164 **** ASTManagerTest.assertIsIn("assertNotEquals", comps); ASTManagerTest.assertIsIn("assertAlmostEquals", comps); ! // ! // ! // ! // ! // ! // ! // ! // token = "unittest.TestCase"; ! // line = 6; ! // col = 18; ! // ! // sDoc = ""+ ! // "from testlib import unittest \n"+ ! // " \n"+ ! // "unittest.TestCase. \n"; ! // ! // doc = new Document(sDoc); ! // comps = manager.getCompletionsForToken(doc, line,col, token, qual, nature); ! // System.out.println("COMPLETIONS ---------------------"); ! // for (int i = 0; i < comps.length; i++) { ! // System.out.println(comps[i].getRepresentation()); ! // } ! // System.out.println("END COMPLETIONS -----------------"); ! // assertTrue(comps.length > 5); } } --- 113,160 ---- ASTManagerTest.assertIsIn("assertNotEquals", comps); ASTManagerTest.assertIsIn("assertAlmostEquals", comps); ! } ! ! public void testClassHierarchyCompletion2(){ ! ! token = "GUITest"; ! line = 3; ! col = 8; ! ! sDoc = ""+ ! "from testlib.unittest import GUITest \n"+ ! " \n"+ ! "GUITest. \n"; ! ! IToken[] comps = null; ! Document doc = new Document(sDoc); ! CompletionState state = new CompletionState(line,col, token, nature); ! comps = manager.getCompletionsForToken(doc, state); ! assertTrue(comps.length > 5); ! ASTManagerTest.assertIsIn("assertEquals", comps); ! ASTManagerTest.assertIsIn("assertNotEquals", comps); ! ASTManagerTest.assertIsIn("assertAlmostEquals", comps); ! ASTManagerTest.assertIsIn("SetWidget", comps); ! } + public void testClassHierarchyCompletion3(){ + + token = "AnotherTest"; + line = 3; + col = 12; + + sDoc = ""+ + "from testlib.unittest import AnotherTest \n"+ + " \n"+ + "AnotherTest. \n"; + IToken[] comps = null; + Document doc = new Document(sDoc); + CompletionState state = new CompletionState(line,col, token, nature); + comps = manager.getCompletionsForToken(doc, state); + assertTrue(comps.length > 5); + ASTManagerTest.assertIsIn("assertEquals", comps); + ASTManagerTest.assertIsIn("assertNotEquals", comps); + ASTManagerTest.assertIsIn("assertAlmostEquals", comps); + ASTManagerTest.assertIsIn("another", comps); } } |