Marco Ricci commited on 2025-11-30 13:54:36
Zeige 20 geänderte Dateien mit 114 Einfügungen und 3 Löschungen.
Consistently add docstrings to all modules in the tests hierarchy that would appear in the (developer setup) documentation.
| ... | ... |
@@ -40,6 +40,7 @@ nav: |
| 40 | 40 |
- pytest configuration: reference/tests.conftest.md |
| 41 | 41 |
- Common testing data: reference/tests.data.md |
| 42 | 42 |
- Common testing machinery: reference/tests.machinery.md |
| 43 |
+ - Miscellaneous test machinery tests: reference/tests.test_000_testing_machinery.md |
|
| 43 | 44 |
- Localization machinery: reference/tests.test_l10n.md |
| 44 | 45 |
- derivepassphrase command-line: |
| 45 | 46 |
- cli module, helpers and machinery: |
| ... | ... |
@@ -2,6 +2,17 @@ |
| 2 | 2 |
# |
| 3 | 3 |
# SPDX-License-Identifier: Zlib |
| 4 | 4 |
|
| 5 |
+"""General machinery for `derivepassphrase` testing data. |
|
| 6 |
+ |
|
| 7 |
+This module contains machinery supplementary to the data from the |
|
| 8 |
+`tests.data` module, such as common dummy functions, or simple parsers |
|
| 9 |
+for (the restricted format in use by) the data. It also contains some |
|
| 10 |
+actual test data that needs to be generated programmatically, or that |
|
| 11 |
+e.g. includes a function from this module as an embedded callback |
|
| 12 |
+parameter. |
|
| 13 |
+ |
|
| 14 |
+""" |
|
| 15 |
+ |
|
| 5 | 16 |
from __future__ import annotations |
| 6 | 17 |
|
| 7 | 18 |
import os |
| ... | ... |
@@ -2,6 +2,14 @@ |
| 2 | 2 |
# |
| 3 | 3 |
# SPDX-License-Identifier: Zlib |
| 4 | 4 |
|
| 5 |
+"""Testing machinery for `derivepassphrase`. |
|
| 6 |
+ |
|
| 7 |
+This is all the standalone, non-test-system-specific machinery used to |
|
| 8 |
+test `derivepassphrase`; this includes global settings, external API |
|
| 9 |
+wrappers, stub systems, and the like. |
|
| 10 |
+ |
|
| 11 |
+""" |
|
| 12 |
+ |
|
| 5 | 13 |
from __future__ import annotations |
| 6 | 14 |
|
| 7 | 15 |
import contextlib |
| ... | ... |
@@ -2,6 +2,16 @@ |
| 2 | 2 |
# |
| 3 | 3 |
# SPDX-License-Identifier: Zlib |
| 4 | 4 |
|
| 5 |
+"""Miscellaneous tests for the test suite's data and machinery. |
|
| 6 |
+ |
|
| 7 |
+At the moment, this only entails testing [the SSH test |
|
| 8 |
+keys][data.ALL_KEYS] for internal consistency. Tests for the [stubbed |
|
| 9 |
+SSH agent][tests.machinery.StubbedSSHAgentSocket] (in all variations) |
|
| 10 |
+are included in the [basic tests for the `derivepassphrase.ssh_agent` |
|
| 11 |
+module][tests.test_derivepassphrase_ssh_agent.test_000_basic]. |
|
| 12 |
+ |
|
| 13 |
+""" |
|
| 14 |
+ |
|
| 5 | 15 |
from __future__ import annotations |
| 6 | 16 |
|
| 7 | 17 |
import base64 |
| ... | ... |
@@ -1,3 +1,36 @@ |
| 1 | 1 |
# SPDX-FileCopyrightText: 2025 Marco Ricci <software@the13thletter.info> |
| 2 | 2 |
# |
| 3 | 3 |
# SPDX-License-Identifier: Zlib |
| 4 |
+ |
|
| 5 |
+"""Tests for the `derivepassphrase` command-line interface. |
|
| 6 |
+ |
|
| 7 |
+There are separate submodules for |
|
| 8 |
+ |
|
| 9 |
+ * [testing basic |
|
| 10 |
+ things][tests.test_derivepassphrase_cli.test_000_basic] |
|
| 11 |
+ |
|
| 12 |
+ * [common testing across all |
|
| 13 |
+ CLIs][tests.test_derivepassphrase_cli.test_all_cli] |
|
| 14 |
+ |
|
| 15 |
+ * [heavy-duty |
|
| 16 |
+ testing][tests.test_derivepassphrase_cli.test_heavy_duty] |
|
| 17 |
+ |
|
| 18 |
+ * [testing shell |
|
| 19 |
+ completion][tests.test_derivepassphrase_cli.test_shell_completion] |
|
| 20 |
+ |
|
| 21 |
+ * [testing transition functions and |
|
| 22 |
+ messages][tests.test_derivepassphrase_cli.test_transition] |
|
| 23 |
+ |
|
| 24 |
+ * [testing internal utility |
|
| 25 |
+ functions][tests.test_derivepassphrase_cli.test_utils] |
|
| 26 |
+ |
|
| 27 |
+ * [testing basic functionality of the `vault` |
|
| 28 |
+ CLI][tests.test_derivepassphrase_cli.test_vault_cli_basic_functionality] |
|
| 29 |
+ |
|
| 30 |
+ * [testing configuration management via the `vault` |
|
| 31 |
+ CLI][tests.test_derivepassphrase_cli.test_vault_cli_config_management] |
|
| 32 |
+ |
|
| 33 |
+ * [testing notes handling in the `vault` |
|
| 34 |
+ CLI][tests.test_derivepassphrase_cli.test_vault_cli_notes_handling] |
|
| 35 |
+ |
|
| 36 |
+""" |
| ... | ... |
@@ -2,6 +2,13 @@ |
| 2 | 2 |
# |
| 3 | 3 |
# SPDX-License-Identifier: Zlib |
| 4 | 4 |
|
| 5 |
+"""Tests for the `derivepassphrase` command-line interface: all subcommands. |
|
| 6 |
+ |
|
| 7 |
+This includes tests for functionality or options common to all |
|
| 8 |
+subcommands. |
|
| 9 |
+ |
|
| 10 |
+""" |
|
| 11 |
+ |
|
| 5 | 12 |
from __future__ import annotations |
| 6 | 13 |
|
| 7 | 14 |
import contextlib |
| ... | ... |
@@ -5,6 +5,13 @@ |
| 5 | 5 |
# TODO(the-13th-letter): Remove this module in v1.0. |
| 6 | 6 |
# https://the13thletter.info/derivepassphrase/latest/upgrade-notes/#upgrading-to-v1.0 |
| 7 | 7 |
|
| 8 |
+"""Tests for the `derivepassphrase` command-line interface: transitional functionality. |
|
| 9 |
+ |
|
| 10 |
+This includes deprecation warnings for deprecated commands or options, |
|
| 11 |
+and functionality provided for ease of transition. |
|
| 12 |
+ |
|
| 13 |
+""" |
|
| 14 |
+ |
|
| 8 | 15 |
from __future__ import annotations |
| 9 | 16 |
|
| 10 | 17 |
import contextlib |
| ... | ... |
@@ -1,3 +1,12 @@ |
| 1 | 1 |
# SPDX-FileCopyrightText: 2025 Marco Ricci <software@the13thletter.info> |
| 2 | 2 |
# |
| 3 | 3 |
# SPDX-License-Identifier: Zlib |
| 4 |
+ |
|
| 5 |
+"""Tests for `derivepassphrase.ssh_agent`. |
|
| 6 |
+ |
|
| 7 |
+There are separate submodules for [basic |
|
| 8 |
+tests][tests.test_derivepassphrase_ssh_agent.test_000_basic] and |
|
| 9 |
+[heavy-duty |
|
| 10 |
+tests][tests.test_derivepassphrase_ssh_agent.test_heavy_duty]. |
|
| 11 |
+ |
|
| 12 |
+""" |
| ... | ... |
@@ -1,3 +1,11 @@ |
| 1 | 1 |
# SPDX-FileCopyrightText: 2025 Marco Ricci <software@the13thletter.info> |
| 2 | 2 |
# |
| 3 | 3 |
# SPDX-License-Identifier: Zlib |
| 4 |
+ |
|
| 5 |
+"""Tests for `derivepassphrase._types`. |
|
| 6 |
+ |
|
| 7 |
+There are separate submodules for [basic |
|
| 8 |
+tests][tests.test_derivepassphrase_types.test_000_basic] and [heavy-duty |
|
| 9 |
+tests][tests.test_derivepassphrase_types.test_heavy_duty]. |
|
| 10 |
+ |
|
| 11 |
+""" |