diff --git a/tests/unit/core/python/_core/test_PythonDefinitionDocumentationGenerator.py b/tests/unit/core/python/_core/test_PythonDefinitionDocumentationGenerator.py
index b4ec9b5..4f44a6c 100644
--- a/tests/unit/core/python/_core/test_PythonDefinitionDocumentationGenerator.py
+++ b/tests/unit/core/python/_core/test_PythonDefinitionDocumentationGenerator.py
@@ -131,7 +131,7 @@ def _signature_section(signature: str) -> str:
[],
),
),
- "a(a = '42') -> str",
+ "a(a='42') -> str",
),
(
PythonDefinitionDocumentationGenerator(
@@ -249,6 +249,46 @@ def _signature_section(signature: str) -> str:
'allow_html: bool = True, level: int = 1) -> None'
),
),
+ (
+ PythonDefinitionDocumentationGenerator(
+ PythonFunctionDefinition(
+ '__init__',
+ [
+ PythonFunctionArgument(
+ 'self',
+ PythonArgumentKind.NORMAL,
+ None,
+ None,
+ ),
+ PythonFunctionArgument(
+ 'definition',
+ PythonArgumentKind.NORMAL,
+ None,
+ 'PythonDefinition',
+ ),
+ PythonFunctionArgument(
+ 'allow_html',
+ PythonArgumentKind.KEYWORD_ONLY,
+ 'True',
+ 'bool',
+ ),
+ PythonFunctionArgument(
+ 'level',
+ PythonArgumentKind.KEYWORD_ONLY,
+ '1',
+ None,
+ ),
+ ],
+ 'None',
+ None,
+ [],
+ ),
+ ),
+ (
+ '__init__(self, definition: PythonDefinition, *, '
+ 'allow_html: bool = True, level=1) -> None'
+ ),
+ ),
],
)
def test_PythonDefinitionDocumentationGenerator_generate_signature(
@@ -371,7 +411,7 @@ def test_PythonDefinitionDocumentationGenerator_generate_signature_exceptions(
[],
),
),
- "a(a = '42') -> str",
+ "a(a='42') -> str",
),
(
PythonDefinitionDocumentationGenerator(
@@ -1796,7 +1836,7 @@ Very long ...
## Function signature
```python
-a(hello: int, /, world = 1, *, something: str = 'something', **value) -> bool
+a(hello: int, /, world=1, *, something: str = 'something', **value) -> bool
```
## Returns
@@ -1938,7 +1978,7 @@ Very long ...
## Function signature
```python
-a(hello: int, /, world = 1, *, something: str = 'something', **value) -> bool
+a(hello: int, /, world=1, *, something: str = 'something', **value) -> bool
```
## Returns
@@ -2081,7 +2121,7 @@ Very long ...
## Function signature
```python
-a(hello: int, /, world = 1, *, something: str = 'something', **value) -> bool
+a(hello: int, /, world=1, *, something: str = 'something', **value) -> bool
```
## Returns
@@ -2191,7 +2231,7 @@ Very long ...
## Function signature
```python
-a(hello: int, /, world = 1, *, something: str = 'something', **value) -> bool
+a(hello: int, /, world=1, *, something: str = 'something', **value) -> bool
```
## Returns
@@ -2301,7 +2341,7 @@ Very long ...
## Function signature
```python
-a(hello: int, /, world = 1, *, something: str = 'something', **value) -> bool
+a(hello: int, /, world=1, *, something: str = 'something', **value) -> bool
```
## Returns
@@ -2446,7 +2486,7 @@ Very long ...
## Function signature
```python
-a(hello: int, /, world = 1, *, something: str = 'something', **value) -> bool
+a(hello: int, /, world=1, *, something: str = 'something', **value) -> bool
```
## Returns
@@ -2592,7 +2632,7 @@ Very long ...
## Function signature
```python
-a(hello: int, /, world = 1, *, something: str = 'something', **value) -> bool
+a(hello: int, /, world=1, *, something: str = 'something', **value) -> bool
```
## Returns
@@ -2705,7 +2745,7 @@ Very long ...
## Function signature
```python
-a(hello: int, /, world = 1, *, something: str = 'something', **value) -> bool
+a(hello: int, /, world=1, *, something: str = 'something', **value) -> bool
```
## Returns
diff --git a/tests/unit/core/python/_core/test_PythonDocumentationGenerator/test_generate_documentation/case02/expected/pkg/module.md b/tests/unit/core/python/_core/test_PythonDocumentationGenerator/test_generate_documentation/case02/expected/pkg/module.md
index c95a23a..113810a 100644
--- a/tests/unit/core/python/_core/test_PythonDocumentationGenerator/test_generate_documentation/case02/expected/pkg/module.md
+++ b/tests/unit/core/python/_core/test_PythonDocumentationGenerator/test_generate_documentation/case02/expected/pkg/module.md
@@ -6,4 +6,34 @@
```python
func()
-```
\ No newline at end of file
+```
+
+## Function `func2`
+
+### Function signature
+
+```python
+func2(a: int, b: int = 42, c=42, d=42)
+```
+
+
+
+### Parameters
+
+| Parameter | Type | Kind | Default value | Description |
+| --- | --- | --- | --- | --- |
+| `a` | `int` | normal | -- | -- |
+| `b` | `int` | normal | `42` | -- |
+| `c` | `int` | normal | `42` | -- |
+| `d` | -- | normal | `42` | -- |
+
+
+
+
+
+
+
+### Docstring
+
+:param c:
+:type c: int
\ No newline at end of file
diff --git a/tests/unit/core/python/_core/test_PythonDocumentationGenerator/test_generate_documentation/case02/project/src/pkg/module.py b/tests/unit/core/python/_core/test_PythonDocumentationGenerator/test_generate_documentation/case02/project/src/pkg/module.py
index 30a3b59..1af50fe 100644
--- a/tests/unit/core/python/_core/test_PythonDocumentationGenerator/test_generate_documentation/case02/project/src/pkg/module.py
+++ b/tests/unit/core/python/_core/test_PythonDocumentationGenerator/test_generate_documentation/case02/project/src/pkg/module.py
@@ -1 +1,8 @@
def func(): ...
+
+
+def func2(a: int, b: int = 42, c=42, d=42):
+ """
+ :param c:
+ :type c: int
+ """
diff --git a/tests/unit/core/python/_core/test_PythonModuleDocumentationGenerator.py b/tests/unit/core/python/_core/test_PythonModuleDocumentationGenerator.py
index d922136..c601d26 100644
--- a/tests/unit/core/python/_core/test_PythonModuleDocumentationGenerator.py
+++ b/tests/unit/core/python/_core/test_PythonModuleDocumentationGenerator.py
@@ -241,6 +241,36 @@ def test_PythonModuleDocumentationGenerator_exceptions(
A test module.
+## Function `fn`
+
+### Function signature
+
+```python
+fn(a: int, b: int = 42, c=42, d=42)
+```
+
+
+
+### Parameters
+
+| Parameter | Type | Kind | Default value | Description |
+| --- | --- | --- | --- | --- |
+| `a` | `int` | normal | -- | -- |
+| `b` | `int` | normal | `42` | -- |
+| `c` | `int` | normal | `42` | -- |
+| `d` | -- | normal | `42` | -- |
+
+
+
+
+
+
+
+### Docstring
+
+:param c:
+:type c: int
+
## Function `add`
Adds two numbers.
@@ -422,6 +452,36 @@ A dog.""",
A test module.
+## Function `fn`
+
+### Function signature
+
+```python
+fn(a: int, b: int = 42, c=42, d=42)
+```
+
+
+
+### Parameters
+
+| Parameter | Type | Kind | Default value | Description |
+| --- | --- | --- | --- | --- |
+| `a` | `int` | normal | -- | -- |
+| `b` | `int` | normal | `42` | -- |
+| `c` | `int` | normal | `42` | -- |
+| `d` | -- | normal | `42` | -- |
+
+
+
+
+
+
+
+### Docstring
+
+:param c:
+:type c: int
+
## Function `add`
Adds two numbers.
@@ -604,6 +664,35 @@ A dog.""",
A test module.
+## Function `fn`
+
+### Function signature
+
+```python
+fn(a: int, b: int = 42, c=42, d=42)
+```
+
+
+
+### Parameters
+
+| Parameter | Type | Kind | Default value | Description |
+| --- | --- | --- | --- | --- |
+| `a` | `int` | normal | -- | -- |
+| `b` | `int` | normal | `42` | -- |
+| `c` | `int` | normal | `42` | -- |
+| `d` | -- | normal | `42` | -- |
+
+
+
+
+
+
+
+Docstring
"""
+ """:param c:
+:type c: int
+
## Function `add`
Adds two numbers.
@@ -782,6 +871,68 @@ Return type: `None`
A test module.
+## Function `fn`
+
+### Function signature
+
+```python
+fn(a: int, b: int = 42, c=42, d=42)
+```
+
+
+
+### Parameters
+
+- Parameter: `a`
+
+ Type: `int`
+
+ Kind: normal
+
+ Default value: --
+
+ Description: --
+
+- Parameter: `b`
+
+ Type: `int`
+
+ Kind: normal
+
+ Default value: `42`
+
+ Description: --
+
+- Parameter: `c`
+
+ Type: `int`
+
+ Kind: normal
+
+ Default value: `42`
+
+ Description: --
+
+- Parameter: `d`
+
+ Type: --
+
+ Kind: normal
+
+ Default value: `42`
+
+ Description: --
+
+
+
+
+
+
+
+Docstring
"""
+ """:param c:
+:type c: int
+
## Function `add`
Adds two numbers.
@@ -1001,6 +1152,69 @@ Return type: `None`
A test module.
+## Function `fn`
+
+### Function signature
+
+```python
+fn(a: int, b: int = 42, c=42, d=42)
+```
+
+
+
+### Parameters
+
+- Parameter: `a`
+
+ Type: `int`
+
+ Kind: normal
+
+ Default value: --
+
+ Description: --
+
+- Parameter: `b`
+
+ Type: `int`
+
+ Kind: normal
+
+ Default value: `42`
+
+ Description: --
+
+- Parameter: `c`
+
+ Type: `int`
+
+ Kind: normal
+
+ Default value: `42`
+
+ Description: --
+
+- Parameter: `d`
+
+ Type: --
+
+ Kind: normal
+
+ Default value: `42`
+
+ Description: --
+
+
+
+
+
+
+
+### Docstring
+
+:param c:
+:type c: int
+
## Function `add`
Adds two numbers.
diff --git a/tests/unit/core/python/_core/test__signature_argument_list.py b/tests/unit/core/python/_core/test__signature_argument_list.py
index b381864..0297b18 100644
--- a/tests/unit/core/python/_core/test__signature_argument_list.py
+++ b/tests/unit/core/python/_core/test__signature_argument_list.py
@@ -341,6 +341,17 @@ from src.jcloud_docsgen.core.python.arguments import (
],
['a: int = 1'],
),
+ (
+ [
+ PythonFunctionArgument(
+ 'a',
+ PythonArgumentKind.NORMAL,
+ '1',
+ None,
+ ),
+ ],
+ ['a=1'],
+ ),
],
)
def test__signature_argument_list(argument_list, expected):
diff --git a/tests/unit/core/python/_core/test_project_dirs/pdir_2/src/pkg/module.py b/tests/unit/core/python/_core/test_project_dirs/pdir_2/src/pkg/module.py
index 7da0ee4..91ee326 100644
--- a/tests/unit/core/python/_core/test_project_dirs/pdir_2/src/pkg/module.py
+++ b/tests/unit/core/python/_core/test_project_dirs/pdir_2/src/pkg/module.py
@@ -3,6 +3,13 @@ A test module.
"""
+def fn(a: int, b: int = 42, c=42, d=42):
+ """
+ :param c:
+ :type c: int
+ """
+
+
def add(a: int | float, b: int | float) -> int | float:
"""
Adds two numbers.
diff --git a/tests/unit/core/python/arguments/test_PythonASTArgumentsListParser.py b/tests/unit/core/python/arguments/test_PythonASTArgumentsListParser.py
index 7af0d65..f6a00ec 100644
--- a/tests/unit/core/python/arguments/test_PythonASTArgumentsListParser.py
+++ b/tests/unit/core/python/arguments/test_PythonASTArgumentsListParser.py
@@ -685,7 +685,7 @@ def argument_list(argument_list: str) -> ast.arguments:
),
(
argument_list(
- "a = 1, b = 'a', /, *args, c = None, d = True, **kwargs",
+ "a=1, b='a', /, *args, c=None, d=True, **kwargs",
),
[
PythonFunctionArgument(
@@ -727,9 +727,7 @@ def argument_list(argument_list: str) -> ast.arguments:
],
),
(
- argument_list(
- "a, b = 'a', /, *args, c = None, d = True, **kwargs"
- ),
+ argument_list("a, b='a', /, *args, c=None, d=True, **kwargs"),
[
PythonFunctionArgument(
'a',
@@ -767,7 +765,7 @@ def argument_list(argument_list: str) -> ast.arguments:
],
),
(
- argument_list('a, b , /, *args, c = None, d = True, **kwargs'),
+ argument_list('a, b , /, *args, c=None, d=True, **kwargs'),
[
PythonFunctionArgument(
'a',
@@ -808,7 +806,7 @@ def argument_list(argument_list: str) -> ast.arguments:
],
),
(
- argument_list('a, b , /, *args, c, d = True, **kwargs'),
+ argument_list('a, b , /, *args, c, d=True, **kwargs'),
[
PythonFunctionArgument(
'a',
@@ -890,7 +888,7 @@ def argument_list(argument_list: str) -> ast.arguments:
],
),
(
- argument_list('a, b , /, *args, c = None, d, **kwargs'),
+ argument_list('a, b , /, *args, c=None, d, **kwargs'),
[
PythonFunctionArgument(
'a',
@@ -931,7 +929,7 @@ def argument_list(argument_list: str) -> ast.arguments:
],
),
(
- argument_list('a = 1'),
+ argument_list('a=1'),
[
PythonFunctionArgument(
'a',
diff --git a/tests/unit/core/python/arguments/test_PythonFunctionArgument.py b/tests/unit/core/python/arguments/test_PythonFunctionArgument.py
index 0652165..52014e0 100644
--- a/tests/unit/core/python/arguments/test_PythonFunctionArgument.py
+++ b/tests/unit/core/python/arguments/test_PythonFunctionArgument.py
@@ -362,7 +362,7 @@ from src.jcloud_docsgen.exceptions import (
'1',
None,
PythonArgumentStructureError,
- '* or ** arguments cannot have default values: *a = 1',
+ '* or ** arguments cannot have default values: *a=1',
),
(
'a',
@@ -370,7 +370,7 @@ from src.jcloud_docsgen.exceptions import (
'1',
None,
PythonArgumentStructureError,
- '* or ** arguments cannot have default values: **a = 1',
+ '* or ** arguments cannot have default values: **a=1',
),
],
)
@@ -498,7 +498,7 @@ def test_PythonFunctionArgument_asterik(name, kind, annotation):
'1',
None,
),
- 'a = 1',
+ 'a=1',
),
(
PythonFunctionArgument(
@@ -531,7 +531,7 @@ def test_PythonFunctionArgument_asterik(name, kind, annotation):
'1',
None,
),
- 'a = 1',
+ 'a=1',
),
(
PythonFunctionArgument(
@@ -567,7 +567,7 @@ def test_PythonFunctionArgument_asterik(name, kind, annotation):
'1',
None,
),
- 'a = 1',
+ 'a=1',
),
(
PythonFunctionArgument(