From 421472656563efd3fb740b22a1e18d17f98701c1 Mon Sep 17 00:00:00 2001 From: Ian Knox Date: Thu, 11 Aug 2022 18:10:32 -0500 Subject: [PATCH] tests --- tests/unit/test_cli.py | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 tests/unit/test_cli.py diff --git a/tests/unit/test_cli.py b/tests/unit/test_cli.py new file mode 100644 index 00000000000..294961c98e7 --- /dev/null +++ b/tests/unit/test_cli.py @@ -0,0 +1,25 @@ +from dbt.cli.main import cli +import click + + +class TestCLI: + def test_commands_have_docstrings(self): + def run_test(commands): + for _, command in commands.items(): + if type(command) is click.core.Command: + assert command.__doc__ is not None + if type(command) is click.core.Group: + run_test(command.commands) + + run_test(cli.commands) + + def test_params_have_help_texts(self): + def run_test(commands): + for _, command in commands.items(): + if type(command) is click.core.Command: + for param in command.params: + assert param.help is not None + if type(command) is click.core.Group: + run_test(command.commands) + + run_test(cli.commands)