aboutsummaryrefslogtreecommitdiff
path: root/tools/interface_generator/bin/templates_unittest.py
blob: acb16853f2d613e788d353db80c0cbb0fb0d04f5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
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())