summaryrefslogtreecommitdiff
path: root/bindings/python/tests/cindex/test_file.py
diff options
context:
space:
mode:
Diffstat (limited to 'bindings/python/tests/cindex/test_file.py')
-rw-r--r--bindings/python/tests/cindex/test_file.py18
1 files changed, 11 insertions, 7 deletions
diff --git a/bindings/python/tests/cindex/test_file.py b/bindings/python/tests/cindex/test_file.py
index 146e8c5705..98f6575262 100644
--- a/bindings/python/tests/cindex/test_file.py
+++ b/bindings/python/tests/cindex/test_file.py
@@ -1,9 +1,13 @@
from clang.cindex import Index, File
-def test_file():
- index = Index.create()
- tu = index.parse('t.c', unsaved_files = [('t.c', "")])
- file = File.from_name(tu, "t.c")
- assert str(file) == "t.c"
- assert file.name == "t.c"
- assert repr(file) == "<File: t.c>"
+import unittest
+
+
+class TestFile(unittest.TestCase):
+ def test_file(self):
+ index = Index.create()
+ tu = index.parse('t.c', unsaved_files = [('t.c', "")])
+ file = File.from_name(tu, "t.c")
+ self.assertEqual(str(file), "t.c")
+ self.assertEqual(file.name, "t.c")
+ self.assertEqual(repr(file), "<File: t.c>")