mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-05-23 05:31:23 +00:00
tests: add Windows skip guards for UNIX-only stdlib imports
This commit is contained in:
parent
b6ff96c057
commit
4e8b8573ca
2 changed files with 5 additions and 5 deletions
|
|
@ -1,7 +1,7 @@
|
||||||
"""Tests for gateway service management helpers."""
|
"""Tests for gateway service management helpers."""
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import pwd
|
pwd = pytest.importorskip("pwd")
|
||||||
import subprocess
|
import subprocess
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from types import SimpleNamespace
|
from types import SimpleNamespace
|
||||||
|
|
@ -1284,7 +1284,7 @@ class TestSystemServiceIdentityRootHandling:
|
||||||
|
|
||||||
def test_auto_detected_root_is_rejected(self, monkeypatch):
|
def test_auto_detected_root_is_rejected(self, monkeypatch):
|
||||||
"""When root is auto-detected (not explicitly requested), raise."""
|
"""When root is auto-detected (not explicitly requested), raise."""
|
||||||
import pwd
|
pwd = pytest.importorskip("pwd")
|
||||||
import grp
|
import grp
|
||||||
|
|
||||||
monkeypatch.delenv("SUDO_USER", raising=False)
|
monkeypatch.delenv("SUDO_USER", raising=False)
|
||||||
|
|
@ -1297,7 +1297,7 @@ class TestSystemServiceIdentityRootHandling:
|
||||||
|
|
||||||
def test_explicit_root_is_allowed(self, monkeypatch):
|
def test_explicit_root_is_allowed(self, monkeypatch):
|
||||||
"""When root is explicitly passed via --run-as-user root, allow it."""
|
"""When root is explicitly passed via --run-as-user root, allow it."""
|
||||||
import pwd
|
pwd = pytest.importorskip("pwd")
|
||||||
import grp
|
import grp
|
||||||
|
|
||||||
root_info = pwd.getpwnam("root")
|
root_info = pwd.getpwnam("root")
|
||||||
|
|
@ -1309,7 +1309,7 @@ class TestSystemServiceIdentityRootHandling:
|
||||||
|
|
||||||
def test_non_root_user_passes_through(self, monkeypatch):
|
def test_non_root_user_passes_through(self, monkeypatch):
|
||||||
"""Normal non-root user works as before."""
|
"""Normal non-root user works as before."""
|
||||||
import pwd
|
pwd = pytest.importorskip("pwd")
|
||||||
import grp
|
import grp
|
||||||
|
|
||||||
monkeypatch.delenv("SUDO_USER", raising=False)
|
monkeypatch.delenv("SUDO_USER", raising=False)
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
"""Tests for FileSyncManager.sync_back() — pull remote changes to host."""
|
"""Tests for FileSyncManager.sync_back() — pull remote changes to host."""
|
||||||
|
|
||||||
import fcntl
|
fcntl = pytest.importorskip("fcntl")
|
||||||
import io
|
import io
|
||||||
import logging
|
import logging
|
||||||
import os
|
import os
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue