aboutsummaryrefslogtreecommitdiff
path: root/tools/interface_generator/bin/templates_unittest.py
diff options
context:
space:
mode:
Diffstat (limited to 'tools/interface_generator/bin/templates_unittest.py')
-rw-r--r--tools/interface_generator/bin/templates_unittest.py30
1 files changed, 30 insertions, 0 deletions
diff --git a/tools/interface_generator/bin/templates_unittest.py b/tools/interface_generator/bin/templates_unittest.py
new file mode 100644
index 0000000..acb1685
--- /dev/null
+++ b/tools/interface_generator/bin/templates_unittest.py
@@ -0,0 +1,30 @@
+"""
+templates unit tests
+"""
+
+import unittest
+from pathlib import Path
+import templates
+
+
+class TemplatesUnittest(unittest.TestCase):
+ """templates unit tests"""
+
+ def test_get_templates_dir_is_valid(self):
+ """verify that default templates dir is valid"""
+ path = templates.get_templates_dir()
+
+ self.assertTrue(isinstance(path, Path))
+ self.assertTrue(path.exists())
+ self.assertTrue(path.is_dir())
+
+ def test_get_templates(self):
+ """verify that templates are available by default"""
+ path = templates.get_templates_dir()
+ 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())