Fix esptool skip condition to use shutil.which
The test was hardcoded to check /usr/bin/esptool, but esptool lives in ~/.local/bin/ on this system. Use shutil.which() to properly search PATH.
This commit is contained in:
parent
64c1505a00
commit
0d684088a4
@ -3,6 +3,7 @@ Test configuration management
|
||||
"""
|
||||
|
||||
import os
|
||||
import shutil
|
||||
from pathlib import Path
|
||||
|
||||
import pytest
|
||||
@ -74,11 +75,10 @@ def test_common_ports():
|
||||
assert len(ports) > 0 # Should return some ports for any platform
|
||||
|
||||
|
||||
@pytest.mark.skipif(not Path("/usr/bin/esptool").exists(), reason="esptool not found")
|
||||
@pytest.mark.skipif(not shutil.which("esptool"), reason="esptool not found in PATH")
|
||||
def test_tool_availability():
|
||||
"""Test tool availability check"""
|
||||
config = ESPToolServerConfig()
|
||||
|
||||
# This should work if esptool is in PATH
|
||||
available = config._check_tool_availability("esptool")
|
||||
assert isinstance(available, bool)
|
||||
assert available is True
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user