def testImports5(self): f, tip = jyimportsTipper.GenerateTip('java.lang') assert f.endswith('rt.jar') tup = self.assertIn('String', tip) self.assertEquals(str(jyimportsTipper.TYPE_CLASS), tup[3]) tip = jyimportsTipper.GenerateTip('java')[1] tup = self.assertIn('lang', tip) self.assertEquals(str(jyimportsTipper.TYPE_IMPORT), tup[3]) tip = jyimportsTipper.GenerateTip('java.lang.String')[1] tup = self.assertIn('indexOf', tip) self.assertEquals(str(jyimportsTipper.TYPE_FUNCTION), tup[3]) tip = jyimportsTipper.GenerateTip('java.lang.String')[1] tup = self.assertIn('charAt', tip) self.assertEquals(str(jyimportsTipper.TYPE_FUNCTION), tup[3]) self.assertEquals('(int)', tup[2]) tup = self.assertIn('format', tip) self.assertEquals(str(jyimportsTipper.TYPE_FUNCTION), tup[3]) self.assertEquals('(string, objectArray)', tup[2]) self.assert_(tup[1].find('[Ljava.lang.Object;') == -1) tup = self.assertIn('getBytes', tip) self.assertEquals(str(jyimportsTipper.TYPE_FUNCTION), tup[3]) self.assert_(tup[1].find('[B') == -1) self.assert_(tup[1].find('byte[]') != -1) f, tip = jyimportsTipper.GenerateTip('__builtin__.str') assert f.endswith('jython.jar') self.assertIn('find', tip) f, tip = jyimportsTipper.GenerateTip('__builtin__.dict') assert f.endswith('jython.jar') self.assertIn('get', tip)
def testTipOnString(self): f, tip = jyimportsTipper.GenerateTip('string') self.assertIn('join', tip) self.assertIn('uppercase', tip)
def testImports3(self): f, tip = jyimportsTipper.GenerateTip('os') assert f.endswith('os.py') ret = self.assertIn('path', tip) self.assertEquals('', ret[2])
def testImports2a(self): f, tip = jyimportsTipper.GenerateTip('org.apache.tools.ant') assert f.endswith('ant.jar') ret = self.assertIn('Task', tip) self.assertEquals('', ret[2])
def testImports2(self): f, tip = jyimportsTipper.GenerateTip('junit.framework') assert f.endswith('junit.jar') ret = self.assertIn('TestCase', tip) self.assertEquals('', ret[2])
def testImports1(self): f, tip = jyimportsTipper.GenerateTip('junit.framework.TestCase') assert f.endswith('junit.jar') ret = self.assertIn('assertEquals', tip)
def testImports1b(self): try: f, tip = jyimportsTipper.GenerateTip('__builtin__.m') self.fail('err') except: pass
def testImports1c(self): f, tip = jyimportsTipper.GenerateTip('java.lang.Class') assert f.endswith('rt.jar')
def testImports1a(self): f, tip = jyimportsTipper.GenerateTip('java.util.HashMap') assert f.endswith('rt.jar')
def testImports(self): tip = jyimportsTipper.GenerateTip('__builtin__')[1] self.assertIn('tuple', tip) self.assertIn('RuntimeError', tip) self.assertIn('RuntimeWarning', tip)