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')
-rwxr-xr-xtools/interface_generator/bin/templates_unittest.py22
1 files changed, 16 insertions, 6 deletions
diff --git a/tools/interface_generator/bin/templates_unittest.py b/tools/interface_generator/bin/templates_unittest.py
index feb418a..a5adf0f 100755
--- a/tools/interface_generator/bin/templates_unittest.py
+++ b/tools/interface_generator/bin/templates_unittest.py
@@ -1,18 +1,28 @@
#!/usr/bin/env python3
-import sys
+"""
+templates unit tests
+"""
+
import unittest
-import templates
from pathlib import Path
+import templates
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() ])
+ """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):
- path = Path(sys.argv[0]).parent / "templates"
+ """verify that templates are available by default"""
+ path = templates.get_templates_dir()
result = templates.get_templates(path)
self.assertGreater(len(result), 0)