test_guard_python_file_docstring.py¶
tests/guard/test_guard_python_file_docstring.py
A Python module docstring is read whole as the file block (2.1).
test_a_docstring_missing_a_tag_is_still_reported
None test_guard_python_file_docstring.test_a_docstring_missing_a_tag_is_still_reported()
Reading the whole docstring must not make the check vacuous.
tests/guard/test_guard_python_file_docstring.py:34
Checks
assert messages == ["File-level doxygen missing @version tag in 'x.py'"]
Result: passed
Verifies
| requirement | linked | path to the implementer |
|---|---|---|
| REQ-DDB-GUARD-006 | measured | test_a_docstring_missing_a_tag_is_still_reported → check_file_presence |
| REQ-DDB-GUARD-019 | measured | test_a_docstring_missing_a_tag_is_still_reported → check_file_presence → _check_file_block_tags → parse_doxygen_tags |
| REQ-DDB-GUARD-024 | inferred | test_a_docstring_missing_a_tag_is_still_reported → check_file_presence → _check_file_block_tags → apply_autobrief |
Source · 7 lines
def test_a_docstring_missing_a_tag_is_still_reported() -> None:
"""@brief Reading the whole docstring must not make the check vacuous."""
source = '"""Summary.\n\n@file x.py\n@brief Does x.\n"""\n'
messages = [v.message for v in check_file_presence("x.py", source, _CONFIG)]
assert messages == ["File-level doxygen missing @version tag in 'x.py'"]
Activity · 3 steps
test_a_one_line_docstring_is_one_block
None test_guard_python_file_docstring.test_a_one_line_docstring_is_one_block()
Opened and closed on one line.
tests/guard/test_guard_python_file_docstring.py:41
Checks
assert check_file_presence("x.py", source, _CONFIG) == []
Result: passed
Verifies
| requirement | linked | path to the implementer |
|---|---|---|
| REQ-DDB-GUARD-006 | measured | test_a_one_line_docstring_is_one_block → check_file_presence |
| REQ-DDB-GUARD-019 | measured | test_a_one_line_docstring_is_one_block → check_file_presence → _check_file_block_tags → parse_doxygen_tags |
| REQ-DDB-GUARD-024 | inferred | test_a_one_line_docstring_is_one_block → check_file_presence → _check_file_block_tags → apply_autobrief |
Source · 4 lines
def test_a_one_line_docstring_is_one_block() -> None:
"""@brief Opened and closed on one line."""
source = '"""@file x.py @brief Does x. @version 1"""\nimport os\n'
assert check_file_presence("x.py", source, _CONFIG) == []1 more lines, not shown
Activity · 2 steps
test_tags_after_a_blank_line_in_a_module_docstring_count
None test_guard_python_file_docstring.test_tags_after_a_blank_line_in_a_module_docstring_count()
The block runs to the closing quotes.
tests/guard/test_guard_python_file_docstring.py:28
Checks
assert check_file_presence("x.py", source, _CONFIG) == []
Result: passed
Verifies
| requirement | linked | path to the implementer |
|---|---|---|
| REQ-DDB-GUARD-006 | measured | test_tags_after_a_blank_line_in_a_module_docstring_count → check_file_presence |
| REQ-DDB-GUARD-019 | measured | test_tags_after_a_blank_line_in_a_module_docstring_count → check_file_presence → _check_file_block_tags → parse_doxygen_tags |
| REQ-DDB-GUARD-024 | inferred | test_tags_after_a_blank_line_in_a_module_docstring_count → check_file_presence → _check_file_block_tags → apply_autobrief |
Source · 6 lines
def test_tags_after_a_blank_line_in_a_module_docstring_count() -> None:
"""@brief The block runs to the closing quotes."""
source = '"""Summary.\n\n@file x.py\n@brief Does x.\n@version 1.0\n"""\n\nimport os\n'
assert check_file_presence("x.py", source, _CONFIG) == []