Package org.python.indexer

Examples of org.python.indexer.Scope.lookupType()


    public void testClassTypeBuiltinAttrs() throws Exception {
        String file = "classtype_builtins.py";
        buildIndex(file);
        NModuleType module = (NModuleType)idx.moduleTable.lookupType(abspath(file));
        Scope mtable = module.getTable();
        assertTrue(mtable.lookupType("MyClass").isClassType());
        assertTrue(mtable.lookupType("MyClassNoDoc").isClassType());
        assertTrue(mtable.lookupType("MyClass").getTable().getParent() == mtable);
        assertEquals(NBinding.Kind.CLASS, mtable.lookup("MyClass").getKind());
        Scope t = mtable.lookupType("MyClass").getTable();
        assertTrue(t.lookupType("__bases__").isTupleType());
View Full Code Here


        String file = "classtype_builtins.py";
        buildIndex(file);
        NModuleType module = (NModuleType)idx.moduleTable.lookupType(abspath(file));
        Scope mtable = module.getTable();
        assertTrue(mtable.lookupType("MyClass").isClassType());
        assertTrue(mtable.lookupType("MyClassNoDoc").isClassType());
        assertTrue(mtable.lookupType("MyClass").getTable().getParent() == mtable);
        assertEquals(NBinding.Kind.CLASS, mtable.lookup("MyClass").getKind());
        Scope t = mtable.lookupType("MyClass").getTable();
        assertTrue(t.lookupType("__bases__").isTupleType());
        assertTrue(t.lookupType("__dict__").isDictType());
View Full Code Here

        buildIndex(file);
        NModuleType module = (NModuleType)idx.moduleTable.lookupType(abspath(file));
        Scope mtable = module.getTable();
        assertTrue(mtable.lookupType("MyClass").isClassType());
        assertTrue(mtable.lookupType("MyClassNoDoc").isClassType());
        assertTrue(mtable.lookupType("MyClass").getTable().getParent() == mtable);
        assertEquals(NBinding.Kind.CLASS, mtable.lookup("MyClass").getKind());
        Scope t = mtable.lookupType("MyClass").getTable();
        assertTrue(t.lookupType("__bases__").isTupleType());
        assertTrue(t.lookupType("__dict__").isDictType());
        assertEquals(idx.builtins.BaseStr, t.lookupType("__name__"));
View Full Code Here

        assertTrue(mtable.lookupType("MyClass").isClassType());
        assertTrue(mtable.lookupType("MyClassNoDoc").isClassType());
        assertTrue(mtable.lookupType("MyClass").getTable().getParent() == mtable);
        assertEquals(NBinding.Kind.CLASS, mtable.lookup("MyClass").getKind());
        Scope t = mtable.lookupType("MyClass").getTable();
        assertTrue(t.lookupType("__bases__").isTupleType());
        assertTrue(t.lookupType("__dict__").isDictType());
        assertEquals(idx.builtins.BaseStr, t.lookupType("__name__"));
        assertEquals(idx.builtins.BaseStr, t.lookupType("__module__"));
        assertEquals(idx.builtins.BaseStr, t.lookupType("__doc__"));
        t = mtable.lookupType("MyClassNoDoc").getTable();
View Full Code Here

        assertTrue(mtable.lookupType("MyClassNoDoc").isClassType());
        assertTrue(mtable.lookupType("MyClass").getTable().getParent() == mtable);
        assertEquals(NBinding.Kind.CLASS, mtable.lookup("MyClass").getKind());
        Scope t = mtable.lookupType("MyClass").getTable();
        assertTrue(t.lookupType("__bases__").isTupleType());
        assertTrue(t.lookupType("__dict__").isDictType());
        assertEquals(idx.builtins.BaseStr, t.lookupType("__name__"));
        assertEquals(idx.builtins.BaseStr, t.lookupType("__module__"));
        assertEquals(idx.builtins.BaseStr, t.lookupType("__doc__"));
        t = mtable.lookupType("MyClassNoDoc").getTable();
        assertEquals(idx.builtins.BaseStr, t.lookupType("__doc__"));
View Full Code Here

        assertTrue(mtable.lookupType("MyClass").getTable().getParent() == mtable);
        assertEquals(NBinding.Kind.CLASS, mtable.lookup("MyClass").getKind());
        Scope t = mtable.lookupType("MyClass").getTable();
        assertTrue(t.lookupType("__bases__").isTupleType());
        assertTrue(t.lookupType("__dict__").isDictType());
        assertEquals(idx.builtins.BaseStr, t.lookupType("__name__"));
        assertEquals(idx.builtins.BaseStr, t.lookupType("__module__"));
        assertEquals(idx.builtins.BaseStr, t.lookupType("__doc__"));
        t = mtable.lookupType("MyClassNoDoc").getTable();
        assertEquals(idx.builtins.BaseStr, t.lookupType("__doc__"));
    }
View Full Code Here

        assertEquals(NBinding.Kind.CLASS, mtable.lookup("MyClass").getKind());
        Scope t = mtable.lookupType("MyClass").getTable();
        assertTrue(t.lookupType("__bases__").isTupleType());
        assertTrue(t.lookupType("__dict__").isDictType());
        assertEquals(idx.builtins.BaseStr, t.lookupType("__name__"));
        assertEquals(idx.builtins.BaseStr, t.lookupType("__module__"));
        assertEquals(idx.builtins.BaseStr, t.lookupType("__doc__"));
        t = mtable.lookupType("MyClassNoDoc").getTable();
        assertEquals(idx.builtins.BaseStr, t.lookupType("__doc__"));
    }
View Full Code Here

        Scope t = mtable.lookupType("MyClass").getTable();
        assertTrue(t.lookupType("__bases__").isTupleType());
        assertTrue(t.lookupType("__dict__").isDictType());
        assertEquals(idx.builtins.BaseStr, t.lookupType("__name__"));
        assertEquals(idx.builtins.BaseStr, t.lookupType("__module__"));
        assertEquals(idx.builtins.BaseStr, t.lookupType("__doc__"));
        t = mtable.lookupType("MyClassNoDoc").getTable();
        assertEquals(idx.builtins.BaseStr, t.lookupType("__doc__"));
    }

    public void testMethodBuiltinAttrs() throws Exception {
View Full Code Here

        assertTrue(t.lookupType("__dict__").isDictType());
        assertEquals(idx.builtins.BaseStr, t.lookupType("__name__"));
        assertEquals(idx.builtins.BaseStr, t.lookupType("__module__"));
        assertEquals(idx.builtins.BaseStr, t.lookupType("__doc__"));
        t = mtable.lookupType("MyClassNoDoc").getTable();
        assertEquals(idx.builtins.BaseStr, t.lookupType("__doc__"));
    }

    public void testMethodBuiltinAttrs() throws Exception {
        String file = "classtype_builtins.py";
        buildIndex(file);
View Full Code Here

    public void testMethodBuiltinAttrs() throws Exception {
        String file = "classtype_builtins.py";
        buildIndex(file);

        Scope mtable = idx.moduleTable.lookupType(abspath(file)).getTable();
        NBinding method = mtable.lookupType("MyClass").getTable().lookup("__init__");
        assertNotNull(method);
        assertEquals(NBinding.Kind.CONSTRUCTOR, method.getKind());
        assertEquals("classtype_builtins.MyClass.__init__", method.getQname());

        NType ftype = mtable.lookupType("MyClass").getTable().lookupType("__init__");
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.