test(api,daemon,skills): skipif(win32) for Linux-only tests (green CI Windows)
Once the collection-level blockers were fixed, the Windows runner finally ran the suite and surfaced 7 pre-existing failures — all tests asserting Linux-only behavior, while the production code already handles non-Linux gracefully: - api test_secrets: chmod(0o000) can't make a file unreadable to its owner on Windows (the 'unreadable -> None' precondition is unreachable) - daemon test_scheduler_cron: patches fcntl.flock; fcntl is None on Windows (scheduler_cron already skips locking on non-Unix) - skills test_runner: system_status memory/uptime/processes/summary read Linux /proc (skill returns a graceful error on Windows; disk test stays, it's portable) Guard each with @pytest.mark.skipif(sys.platform == 'win32', reason=...). 68 tests pass on Linux, ruff clean, api+daemon audit 100%. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.8
parent
d94336d783
commit
8ad4de11eb
@@ -33,9 +33,12 @@ Tests — api_key.py (get_secret_cmd):
|
||||
from __future__ import annotations
|
||||
|
||||
import json
|
||||
import sys
|
||||
from pathlib import Path
|
||||
from unittest.mock import patch, MagicMock
|
||||
|
||||
import pytest
|
||||
|
||||
from aipass.api.apps.modules.api_key import handle_command as _hc # noqa: F401 — seedgo test_coverage detection
|
||||
from aipass.api.apps.handlers.auth.secrets import (
|
||||
get_secret,
|
||||
@@ -140,6 +143,10 @@ class TestGetSecret:
|
||||
assert result is None
|
||||
mock_logger.warning.assert_called()
|
||||
|
||||
@pytest.mark.skipif(
|
||||
sys.platform == "win32",
|
||||
reason="chmod(0o000) does not make a file unreadable to its owner on Windows",
|
||||
)
|
||||
def test_unreadable_file_returns_none(self, tmp_path: Path) -> None:
|
||||
"""OSError when reading file returns None."""
|
||||
provider_dir = tmp_path / "telegram"
|
||||
|
||||
Reference in New Issue
Block a user