test(cli): cover Brave binary CDP launch detection

This commit is contained in:
H-Ali13381 2026-05-18 23:33:42 -04:00 committed by Teknium
parent 697d38a3f4
commit 6a6766fb89

View file

@ -160,6 +160,18 @@ class TestChromeDebugLaunch:
assert command is not None
assert command.startswith(f"{brave} --remote-debugging-port=9222")
def test_linux_candidates_include_brave_binary_name(self):
brave = "/usr/bin/brave"
with patch("hermes_cli.browser_connect.shutil.which", side_effect=lambda name: brave if name == "brave" else None), \
patch("hermes_cli.browser_connect.os.path.isfile", side_effect=lambda path: path == brave):
candidates = get_chrome_debug_candidates("Linux")
command = manual_chrome_debug_command(9222, "Linux")
assert candidates == [brave]
assert command is not None
assert command.startswith(f"{brave} --remote-debugging-port=9222")
def test_linux_candidates_include_official_brave_and_edge_stable_paths(self):
brave = "/usr/bin/brave-browser-stable"
edge = "/usr/bin/microsoft-edge-stable"