diff options
Diffstat (limited to 'bindings/python/tests/cindex/test_index.py')
-rw-r--r-- | bindings/python/tests/cindex/test_index.py | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/bindings/python/tests/cindex/test_index.py b/bindings/python/tests/cindex/test_index.py index ef76692a52..cfdf98e628 100644 --- a/bindings/python/tests/cindex/test_index.py +++ b/bindings/python/tests/cindex/test_index.py @@ -1,17 +1,21 @@ from clang.cindex import * import os +import unittest + kInputsDir = os.path.join(os.path.dirname(__file__), 'INPUTS') -def test_create(): - index = Index.create() -# FIXME: test Index.read +class TestIndex(unittest.TestCase): + def test_create(self): + index = Index.create() + + # FIXME: test Index.read -def test_parse(): - index = Index.create() - assert isinstance(index, Index) - tu = index.parse(os.path.join(kInputsDir, 'hello.cpp')) - assert isinstance(tu, TranslationUnit) - tu = index.parse(None, ['-c', os.path.join(kInputsDir, 'hello.cpp')]) - assert isinstance(tu, TranslationUnit) + def test_parse(self): + index = Index.create() + self.assertIsInstance(index, Index) + tu = index.parse(os.path.join(kInputsDir, 'hello.cpp')) + self.assertIsInstance(tu, TranslationUnit) + tu = index.parse(None, ['-c', os.path.join(kInputsDir, 'hello.cpp')]) + self.assertIsInstance(tu, TranslationUnit) |