diff options
-rw-r--r-- | tools/interface_generator/bin/BUILD.bazel | 8 | ||||
-rw-r--r-- | tools/interface_generator/bin/interface_declaration.py (renamed from tools/interface_generator/bin/interface_definition.py) | 6 | ||||
-rw-r--r-- | tools/interface_generator/bin/interface_declaration_unittest.py | 19 | ||||
-rw-r--r-- | tools/interface_generator/bin/interface_definition_unittest.py | 19 | ||||
-rwxr-xr-x | tools/interface_generator/bin/interface_generator.py | 8 |
5 files changed, 30 insertions, 30 deletions
diff --git a/tools/interface_generator/bin/BUILD.bazel b/tools/interface_generator/bin/BUILD.bazel index df23387..04843b9 100644 --- a/tools/interface_generator/bin/BUILD.bazel +++ b/tools/interface_generator/bin/BUILD.bazel @@ -1,11 +1,11 @@ load("@pip//:requirements.bzl", "requirement") load("//private:defs.bzl", "py_pytest") -""" interface definition """ +""" interface declaration """ py_library( - name = "interface_definition", - srcs = ["interface_definition.py"], + name = "interface_declaration", + srcs = ["interface_declaration.py"], ) """ templates """ @@ -27,7 +27,7 @@ py_binary( imports = ["."], visibility = ["//visibility:public"], deps = [ - ":interface_definition", + ":interface_declaration", ":templates", requirement("mako"), ], diff --git a/tools/interface_generator/bin/interface_definition.py b/tools/interface_generator/bin/interface_declaration.py index 2fd7e9a..4560bbd 100644 --- a/tools/interface_generator/bin/interface_definition.py +++ b/tools/interface_generator/bin/interface_declaration.py @@ -1,5 +1,5 @@ """ -interface_definition.py +interface_declaration.py """ from dataclasses import dataclass, asdict @@ -7,8 +7,8 @@ from pathlib import Path @dataclass -class InterfaceDefinition: - """interface definition class""" +class InterfaceDeclaration: + """interface declaration class""" name: str license_hdr: str diff --git a/tools/interface_generator/bin/interface_declaration_unittest.py b/tools/interface_generator/bin/interface_declaration_unittest.py new file mode 100644 index 0000000..b2ad80c --- /dev/null +++ b/tools/interface_generator/bin/interface_declaration_unittest.py @@ -0,0 +1,19 @@ +""" +interface declaration unit tests +""" + +import unittest +from interface_declaration import InterfaceDeclaration + + +class InterfaceDeclarationUnittest(unittest.TestCase): + """interface_declaration unit tests""" + + def test_interfacedeclaration_class_asdict(self): + """test mock interface""" + interface = InterfaceDeclaration("kstdio", None) + interface_dict = interface.into_dict() + + self.assertEqual(interface.name, "kstdio") + self.assertEqual(len(interface.license_hdr), 0) + self.assertEqual(interface_dict["name"], "kstdio") diff --git a/tools/interface_generator/bin/interface_definition_unittest.py b/tools/interface_generator/bin/interface_definition_unittest.py deleted file mode 100644 index b459cb4..0000000 --- a/tools/interface_generator/bin/interface_definition_unittest.py +++ /dev/null @@ -1,19 +0,0 @@ -""" -interface definition unit tests -""" - -import unittest -from interface_definition import InterfaceDefinition - - -class InterfaceDefinitionUnittest(unittest.TestCase): - """interface_definition unit tests""" - - def test_interfacedefinition_class_asdict(self): - """test mock interface""" - interface = InterfaceDefinition("kstdio", None) - interface_dict = interface.into_dict() - - self.assertEqual(interface.name, "kstdio") - self.assertEqual(len(interface.license_hdr), 0) - self.assertEqual(interface_dict["name"], "kstdio") diff --git a/tools/interface_generator/bin/interface_generator.py b/tools/interface_generator/bin/interface_generator.py index 0534709..eab93d7 100755 --- a/tools/interface_generator/bin/interface_generator.py +++ b/tools/interface_generator/bin/interface_generator.py @@ -8,7 +8,7 @@ from argparse import ArgumentParser from pathlib import Path import sys from mako.lookup import TemplateLookup -from interface_definition import InterfaceDefinition +from interface_declaration import InterfaceDeclaration from templates import get_templates, get_templates_dir PROG = { @@ -18,7 +18,7 @@ PROG = { def generate_file( - template: Path, templates: Path, output, interface: InterfaceDefinition + template: Path, templates: Path, output, interface: InterfaceDeclaration ): """generate file using a tempalte and write it to the output location""" lookup = TemplateLookup(directories=[".", templates.absolute()]) @@ -40,7 +40,7 @@ def main(): """main function""" parser = ArgumentParser( prog="interface_generator", - description="Generate C header and mock files from an interface definition", + description="Generate C header and mock files from an interface declaration", ) parser.add_argument( "-i", @@ -74,7 +74,7 @@ def main(): args = parser.parse_args() # print(args) - interface = InterfaceDefinition(args.interface, args.license) + interface = InterfaceDeclaration(args.interface, args.license) # print(interface) for template in get_templates(args.templates): |