mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2026-11-08 03:38:23 +00:00
Stop importing __main__ from package __init__.py to prevent runpy RuntimeWarning when using `python -m`. - Move CLI logic into command.py modules - Keep __main__.py as thin wrappers - Update unit tests to import command modules directly https://chatgpt.com/share/6947fb8e-550c-800f-8323-e36f92cb5bba
28 lines
823 B
Python
28 lines
823 B
Python
from __future__ import annotations
|
|
|
|
import unittest
|
|
|
|
from cli.deploy.dedicated import command as dedicated_main
|
|
|
|
|
|
class TestDedicatedMainParser(unittest.TestCase):
|
|
def test_build_parser_has_expected_core_args(self):
|
|
parser = dedicated_main.build_parser()
|
|
|
|
# Smoke-check: parser exists and has some core options
|
|
opts = {a.dest for a in parser._actions} # noqa: SLF001 (test-only introspection)
|
|
|
|
self.assertIn("inventory", opts)
|
|
self.assertIn("limit", opts)
|
|
self.assertIn("host_type", opts)
|
|
self.assertIn("password_file", opts)
|
|
self.assertIn("skip_build", opts)
|
|
self.assertIn("id", opts)
|
|
self.assertIn("verbose", opts)
|
|
self.assertIn("logs", opts)
|
|
self.assertIn("diff", opts)
|
|
|
|
|
|
if __name__ == "__main__":
|
|
unittest.main()
|