def testNameResolution(self): program = util.source(''' class A(B): pass class B(A): pass ''') ast = parse(lex(program)) globalScope = Scope() semantic.collectNames(ast, globalScope) semantic.resolveNames(ast, globalScope)
def testCollectNames(self): program = util.source(''' class A(B): pass class B(A): pass ''') ast = parse(lex(program)) globalScope = Scope() semantic.collectNames(ast, globalScope) self.assertTrue('A' in globalScope.symbols) self.assertTrue('B' in globalScope.symbols)