File size: 552 Bytes
999bb04
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
from __future__ import annotations

from aura.core.platform import detect_platform, open_path, supports_unix_sockets


def test_detect_platform():
    info = detect_platform()
    assert info.system
    assert isinstance(supports_unix_sockets(), bool)


def test_open_path_failure_is_structured(monkeypatch):
    monkeypatch.setattr("aura.core.platform.subprocess.Popen", lambda *_args, **_kwargs: (_ for _ in ()).throw(RuntimeError("boom")))
    result = open_path("/tmp/example")
    assert result.ok is False
    assert result.action == "open_path"