mirror of
https://github.com/PR0M3TH3AN/SeedPass.git
synced 2026-11-06 21:02:04 +00:00
test: gracefully skip test_ai_tui_agent_harness on Windows
Co-authored-by: PR0M3TH3AN <[email protected]>
This commit is contained in:
1 parent
b8b331b42e
commit
6db570f2a7
3 files changed
+82
-29
No files matched your search
@@ -6,6 +6,9 @@ import sys
|
||||
|
||||
import pytest
|
||||
|
||||
pytest.importorskip("pty")
|
||||
pytest.importorskip("termios")
|
||||
|
||||
|
||||
def _load_harness_module():
|
||||
repo_root = Path(__file__).resolve().parents[2]
|
||||
@@ -14,14 +17,24 @@ def _load_harness_module():
|
||||
assert spec is not None and spec.loader is not None
|
||||
module = importlib.util.module_from_spec(spec)
|
||||
sys.modules[spec.name] = module
|
||||
spec.loader.exec_module(module)
|
||||
|
||||
try:
|
||||
spec.loader.exec_module(module)
|
||||
except ModuleNotFoundError as e:
|
||||
pytest.skip(f"Skipping test due to missing module: {e}")
|
||||
|
||||
return module
|
||||
|
||||
|
||||
harness = _load_harness_module()
|
||||
try:
|
||||
harness = _load_harness_module()
|
||||
except pytest.skip.Exception:
|
||||
harness = None
|
||||
|
||||
|
||||
def test_run_step_records_passed_result():
|
||||
if not harness:
|
||||
pytest.skip("Harness not loaded")
|
||||
results = []
|
||||
called = {"value": False}
|
||||
|
||||
@@ -38,6 +51,8 @@ def test_run_step_records_passed_result():
|
||||
|
||||
|
||||
def test_run_step_records_failed_result_and_reraises():
|
||||
if not harness:
|
||||
pytest.skip("Harness not loaded")
|
||||
results = []
|
||||
|
||||
def _boom():
|
||||
@@ -53,6 +68,9 @@ def test_run_step_records_failed_result_and_reraises():
|
||||
|
||||
|
||||
def test_add_entry_menu_open_waits_when_choice_omitted():
|
||||
if not harness:
|
||||
pytest.skip("Harness not loaded")
|
||||
|
||||
class Runner:
|
||||
def __init__(self):
|
||||
self.sent = []
|
||||
@@ -72,6 +90,9 @@ def test_add_entry_menu_open_waits_when_choice_omitted():
|
||||
|
||||
|
||||
def test_add_entry_menu_open_sends_choice_when_provided():
|
||||
if not harness:
|
||||
pytest.skip("Harness not loaded")
|
||||
|
||||
class Runner:
|
||||
def __init__(self):
|
||||
self.sent = []
|
||||
@@ -92,6 +113,9 @@ def test_add_entry_menu_open_sends_choice_when_provided():
|
||||
|
||||
|
||||
def test_complete_onboarding_reaches_main_menu_and_sends_password():
|
||||
if not harness:
|
||||
pytest.skip("Harness not loaded")
|
||||
|
||||
class Runner:
|
||||
def __init__(self):
|
||||
self.calls = [
|
||||
@@ -122,6 +146,9 @@ def test_complete_onboarding_reaches_main_menu_and_sends_password():
|
||||
|
||||
|
||||
def test_complete_onboarding_times_out_without_expected_prompts():
|
||||
if not harness:
|
||||
pytest.skip("Harness not loaded")
|
||||
|
||||
class Runner:
|
||||
def try_wait_for(self, pattern, timeout):
|
||||
return False
|
||||
@@ -138,6 +165,9 @@ def test_complete_onboarding_times_out_without_expected_prompts():
|
||||
|
||||
|
||||
def test_drain_to_main_menu_uses_helper_prompt_then_returns():
|
||||
if not harness:
|
||||
pytest.skip("Harness not loaded")
|
||||
|
||||
class Runner:
|
||||
def __init__(self):
|
||||
self.main_attempts = 0
|
||||
@@ -164,6 +194,9 @@ def test_drain_to_main_menu_uses_helper_prompt_then_returns():
|
||||
|
||||
|
||||
def test_drain_to_main_menu_times_out_when_no_prompt_progress(monkeypatch):
|
||||
if not harness:
|
||||
pytest.skip("Harness not loaded")
|
||||
|
||||
class Runner:
|
||||
def wait_for(self, pattern, timeout):
|
||||
raise harness.TUIHarnessError("missing")
|
||||
|
||||
Reference in new issue
Block a user