test(computer_use): isolate backend env in check_fn test
This commit is contained in:
parent
8eb7aa5966
commit
e81ac4b192
@ -115,11 +115,12 @@ class TestRegistration:
|
||||
import tools.computer_use_tool # noqa: F401
|
||||
from tools.registry import registry
|
||||
entry = registry._tools["computer_use"]
|
||||
if sys.platform == "win32":
|
||||
from tools.computer_use.windows_backend import windows_backend_available
|
||||
assert entry.check_fn() is windows_backend_available()
|
||||
elif sys.platform != "darwin":
|
||||
assert entry.check_fn() is False
|
||||
with patch.dict(os.environ, {}, clear=True):
|
||||
if sys.platform == "win32":
|
||||
from tools.computer_use.windows_backend import windows_backend_available
|
||||
assert entry.check_fn() is windows_backend_available()
|
||||
elif sys.platform != "darwin":
|
||||
assert entry.check_fn() is False
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user