Marco Ricci commited on 2025-11-26 20:49:34
Zeige 5 geänderte Dateien mit 26 Einfügungen und 17 Löschungen.
| ... | ... |
@@ -60,7 +60,10 @@ nav: |
| 60 | 60 |
- Overview: reference/tests.test_derivepassphrase_ssh_agent.md |
| 61 | 61 |
- Basic tests: reference/tests.test_derivepassphrase_ssh_agent.test_000_basic.md |
| 62 | 62 |
- Heavy-duty tests: reference/tests.test_derivepassphrase_ssh_agent.test_heavy_duty.md |
| 63 |
- - _types module: reference/tests.test_derivepassphrase_types.md |
|
| 63 |
+ - _types module: |
|
| 64 |
+ - Overview: reference/tests.test_derivepassphrase_types.md |
|
| 65 |
+ - Basic tests: reference/tests.test_derivepassphrase_types.test_000_basic.md |
|
| 66 |
+ - Heavy-duty tests: reference/tests.test_derivepassphrase_types.test_heavy_duty.md |
|
| 64 | 67 |
- vault module: reference/tests.test_derivepassphrase_vault.md |
| 65 | 68 |
- Design & Background: |
| 66 | 69 |
- explanation/index.md |
| ... | ... |
@@ -363,8 +363,9 @@ def spawn_named_agent( |
| 363 | 363 |
tear down the communication channel and terminate the SSH agent. |
| 364 | 364 |
|
| 365 | 365 |
The SSH agent's instructions for setting up the communication |
| 366 |
- channel are parsed with [`tests.parse_sh_export_line`][]. See the |
|
| 367 |
- caveats there. |
|
| 366 |
+ channel are parsed with |
|
| 367 |
+ [`tests.data.callables.parse_sh_export_line`][]. See the caveats |
|
| 368 |
+ there. |
|
| 368 | 369 |
|
| 369 | 370 |
Args: |
| 370 | 371 |
exec_name: |
| ... | ... |
@@ -22,8 +22,8 @@ from typing import TYPE_CHECKING |
| 22 | 22 |
import hypothesis |
| 23 | 23 |
from hypothesis import strategies |
| 24 | 24 |
|
| 25 |
-from tests import data, machinery |
|
| 26 | 25 |
from derivepassphrase import _types |
| 26 |
+from tests import data, machinery |
|
| 27 | 27 |
|
| 28 | 28 |
__all__ = () |
| 29 | 29 |
|
| ... | ... |
@@ -115,17 +115,18 @@ def smudged_vault_test_config( |
| 115 | 115 |
|
| 116 | 116 |
Uses [`_types.js_truthiness`][] internally, which is tested |
| 117 | 117 |
separately by |
| 118 |
- [`tests.test_derivepassphrase_types.test_100_js_truthiness`][]. |
|
| 118 |
+ [`tests.test_derivepassphrase_types.test_heavy_duty.test_js_truthiness`][]. |
|
| 119 | 119 |
|
| 120 | 120 |
Args: |
| 121 | 121 |
draw: |
| 122 | 122 |
The `draw` function, as provided for by hypothesis. |
| 123 | 123 |
config: |
| 124 |
- A strategy which generates [`VaultTestConfig`][] objects. |
|
| 124 |
+ A strategy which generates [`data.VaultTestConfig`][] |
|
| 125 |
+ objects. |
|
| 125 | 126 |
|
| 126 | 127 |
Returns: |
| 127 |
- A new [`VaultTestConfig`][] where some falsy values have been |
|
| 128 |
- replaced or added. |
|
| 128 |
+ A new [`data.VaultTestConfig`][] where some falsy values have |
|
| 129 |
+ been replaced or added. |
|
| 129 | 130 |
|
| 130 | 131 |
""" |
| 131 | 132 |
|
| ... | ... |
@@ -15,6 +15,9 @@ from typing_extensions import Any |
| 15 | 15 |
|
| 16 | 16 |
from derivepassphrase import _types, cli |
| 17 | 17 |
from derivepassphrase._internals import cli_helpers |
| 18 |
+from derivepassphrase._internals import ( |
|
| 19 |
+ cli_machinery as cli_machinery, # noqa: PLC0414 |
|
| 20 |
+) |
|
| 18 | 21 |
from tests import data, machinery |
| 19 | 22 |
from tests.machinery import pytest as pytest_machinery |
| 20 | 23 |
|
| ... | ... |
@@ -32,7 +35,8 @@ DUMMY_CONFIG_SETTINGS = data.DUMMY_CONFIG_SETTINGS |
| 32 | 35 |
def bash_format(item: click.shell_completion.CompletionItem) -> str: |
| 33 | 36 |
"""A formatter for `bash`-style shell completion items. |
| 34 | 37 |
|
| 35 |
- The format is `type,value`, and is dictated by [`click`][]. |
|
| 38 |
+ The format is `type,value`, and is dictated by |
|
| 39 |
+ [`click`](https://pypi.org/project/click/). |
|
| 36 | 40 |
|
| 37 | 41 |
""" |
| 38 | 42 |
type, value = ( # noqa: A001 |
| ... | ... |
@@ -45,7 +49,8 @@ def bash_format(item: click.shell_completion.CompletionItem) -> str: |
| 45 | 49 |
def fish_format(item: click.shell_completion.CompletionItem) -> str: |
| 46 | 50 |
r"""A formatter for `fish`-style shell completion items. |
| 47 | 51 |
|
| 48 |
- The format is `type,value<tab>help`, and is dictated by [`click`][]. |
|
| 52 |
+ The format is `type,value<tab>help`, and is dictated by |
|
| 53 |
+ [`click`](https://pypi.org/project/click/). |
|
| 49 | 54 |
|
| 50 | 55 |
""" |
| 51 | 56 |
type, value, help = ( # noqa: A001 |
| ... | ... |
@@ -60,11 +65,11 @@ def zsh_format(item: click.shell_completion.CompletionItem) -> str: |
| 60 | 65 |
r"""A formatter for `zsh`-style shell completion items. |
| 61 | 66 |
|
| 62 | 67 |
The format is `type<newline>value<newline>help<newline>`, and is |
| 63 |
- dictated by [`click`][]. Upstream `click` up to and including |
|
| 64 |
- v8.2.1 does not deal with colons in the value correctly when the |
|
| 65 |
- help text is non-degenerate. Our formatter here does, provided the |
|
| 66 |
- upstream `zsh` completion script is used; see the |
|
| 67 |
- [`cli_machinery.ZshComplete`][] class. |
|
| 68 |
+ dictated by [`click`](https://pypi.org/project/click/). Upstream |
|
| 69 |
+ `click` up to and including v8.2.1 does not deal with colons in the |
|
| 70 |
+ value correctly when the help text is non-degenerate. Our formatter |
|
| 71 |
+ here does, provided the upstream `zsh` completion script is used; |
|
| 72 |
+ see the [`cli_machinery.ZshComplete`][] class. |
|
| 68 | 73 |
|
| 69 | 74 |
""" |
| 70 | 75 |
empty_help = "_" |
| ... | ... |
@@ -20,7 +20,6 @@ import types |
| 20 | 20 |
from typing import TYPE_CHECKING, NamedTuple |
| 21 | 21 |
|
| 22 | 22 |
import click |
| 23 |
-import click.testing |
|
| 24 | 23 |
import hypothesis |
| 25 | 24 |
import pytest |
| 26 | 25 |
from hypothesis import strategies |
| ... | ... |
@@ -827,7 +826,7 @@ class TestShellExportScriptParsing: |
| 827 | 826 |
def test_sh_export_line_parsing( |
| 828 | 827 |
self, line: str, env_name: str, value: str | None |
| 829 | 828 |
) -> None: |
| 830 |
- """[`tests.parse_sh_export_line`][] works.""" |
|
| 829 |
+ """[`tests.data.callables.parse_sh_export_line`][] works.""" |
|
| 831 | 830 |
if value is not None: |
| 832 | 831 |
assert ( |
| 833 | 832 |
callables.parse_sh_export_line(line, env_name=env_name) |
| 834 | 833 |