aboutsummaryrefslogtreecommitdiff
path: root/tools/interface_generator/bin/templates_unittest.py
diff options
context:
space:
mode:
authoraqua <aqua@iserlohn-fortress.net>2024-08-18 15:08:13 +0300
committeraqua <aqua@iserlohn-fortress.net>2024-08-18 15:08:13 +0300
commitff0286195eeb4dc659863af4afbdf9ddd4d53a1b (patch)
tree94b06a2efdf8b349f7822dd79f5a6de5780bcbe3 /tools/interface_generator/bin/templates_unittest.py
parentMoved pytest to private (diff)
downloadkernel-ff0286195eeb4dc659863af4afbdf9ddd4d53a1b.tar.xz
Moved interface_generator script to bin
Diffstat (limited to 'tools/interface_generator/bin/templates_unittest.py')
-rwxr-xr-xtools/interface_generator/bin/templates_unittest.py26
1 files changed, 26 insertions, 0 deletions
diff --git a/tools/interface_generator/bin/templates_unittest.py b/tools/interface_generator/bin/templates_unittest.py
new file mode 100755
index 0000000..feb418a
--- /dev/null
+++ b/tools/interface_generator/bin/templates_unittest.py
@@ -0,0 +1,26 @@
+#!/usr/bin/env python3
+
+import sys
+import unittest
+import templates
+from pathlib import Path
+
+
+class Templates(unittest.TestCase):
+ def test_templates_dir_in_argv_0(self):
+ path = Path(sys.argv[0]).parent
+ self.assertTrue("templates" in [ item.name for item in path.iterdir() ])
+
+ def test_get_templates(self):
+ path = Path(sys.argv[0]).parent / "templates"
+ result = templates.get_templates(path)
+
+ self.assertGreater(len(result), 0)
+ for template in result:
+ self.assertTrue(isinstance(template, Path))
+ self.assertTrue(template.exists())
+ self.assertTrue(template.is_file())
+
+
+if __name__ == "__main__":
+ unittest.main()