Feat(cli): add base command-line interface #16

Merged
jakob.scheid merged 21 commits from feature/cli into main 2026-09-13 20:11:00 +02:00
Showing only changes of commit bd7780f112 - Show all commits
+102
View File
@@ -15,6 +15,108 @@
import pathlib import pathlib
import pytest import pytest
from jcloud_docsgen.cli.cli import create_argument_parser, main as cli_main from jcloud_docsgen.cli.cli import create_argument_parser, main as cli_main
from jcloud_docsgen.cli.languages.python import parse_sections_list
from jcloud_docsgen.core.python import PythonDefinitionDocumentationIncludeSections
@pytest.mark.parametrize('include,exclude,expected', [
(
[],
[],
PythonDefinitionDocumentationIncludeSections(
signature = False,
returns = False,
params = False,
exceptions = False,
examples = False,
docstring = False,
bases = False,
decorators = False,
class_body = False
)
),
(
[],
['signature'],
PythonDefinitionDocumentationIncludeSections(
signature = False,
returns = False,
params = False,
exceptions = False,
examples = False,
docstring = False,
bases = False,
decorators = False,
class_body = False
)
),
(
['signature'],
['signature'],
PythonDefinitionDocumentationIncludeSections(
signature = False,
returns = False,
params = False,
exceptions = False,
examples = False,
docstring = False,
bases = False,
decorators = False,
class_body = False
)
),
(
['signature'],
[],
PythonDefinitionDocumentationIncludeSections(
signature = True,
returns = False,
params = False,
exceptions = False,
examples = False,
docstring = False,
bases = False,
decorators = False,
class_body = False
)
),
(
None,
[],
PythonDefinitionDocumentationIncludeSections()
),
(
['signature', 'exceptions', 'bases', 'class_body'],
['signature', 'bases'],
PythonDefinitionDocumentationIncludeSections(
signature = False,
returns = False,
params = False,
exceptions = True,
examples = False,
docstring = False,
bases = False,
decorators = False,
class_body = True
)
),
(
None,
['params', 'docstring'],
PythonDefinitionDocumentationIncludeSections(
signature = True,
returns = True,
params = False,
exceptions = True,
examples = True,
docstring = False,
bases = True,
decorators = True,
class_body = True
)
)
])
def test_parse_sections_list(include, exclude, expected):
assert parse_sections_list(include, exclude) == expected
def test_sections_error(): def test_sections_error():
parser = create_argument_parser() parser = create_argument_parser()