mirror of
https://github.com/NCBM/plyngent.git
synced 2026-11-07 15:37:55 +08:00
test: cover declined, timed out, cancelled and absent prompts
The four kinds and the words each produces, at the registry level and through the four policy gates: a timeout names its deadline, a decline carries the comment, and neither is reported as the other. The existing denial assertions now expect the specific clause.
This commit is contained in:
@@ -8,6 +8,7 @@ from typing import TYPE_CHECKING
|
||||
import pytest
|
||||
import tomlkit
|
||||
|
||||
from plyngent.agent import Denial, DenialKind
|
||||
from plyngent.cli.slash import handle_slash
|
||||
from plyngent.cli.state import ReplState
|
||||
from plyngent.config.models import DatabaseConfig, OpenAIProvider
|
||||
@@ -154,7 +155,8 @@ def test_yolo_denies_the_directory_access_prompt_when_nobody_answers(
|
||||
) -> None:
|
||||
state.set_yolo("on")
|
||||
with temporary_backend(NonInteractiveBackend()):
|
||||
assert state.directory_access_confirm_hook(tmp_path, AccessMode.READ, "", 1.0) is None
|
||||
answer = state.directory_access_confirm_hook(tmp_path, AccessMode.READ, "", 1.0)
|
||||
assert answer == Denial(DenialKind.NO_PROMPT)
|
||||
|
||||
|
||||
async def test_config_allow_paths_installed(
|
||||
|
||||
Reference in New Issue
Block a user