from clang.cindex import * import os kInputsDir = os.path.join(os.path.dirname(__file__), 'INPUTS') def test_spelling(): path = os.path.join(kInputsDir, 'hello.cpp') index = Index.create() tu = index.parse(path) assert str(tu.spelling) == path def test_cursor(): path = os.path.join(kInputsDir, 'hello.cpp') index = Index.create() tu = index.parse(path) c = tu.cursor assert isinstance(c, Cursor) assert c.is_translation_unit