28 lines
775 B
Python
28 lines
775 B
Python
from __future__ import annotations
|
|
|
|
from app.hardware import _select_trigger_candidate_index
|
|
|
|
|
|
def test_select_trigger_candidate_by_unique_trigger_code() -> None:
|
|
candidates = [
|
|
("DELL U2720Q", 60),
|
|
("Generic PnP Monitor", 19),
|
|
]
|
|
assert _select_trigger_candidate_index(candidates) == 1
|
|
|
|
|
|
def test_select_trigger_candidate_by_generic_tiebreaker() -> None:
|
|
candidates = [
|
|
("DELL U2720Q", 15),
|
|
("Generic PnP Monitor", 19),
|
|
]
|
|
assert _select_trigger_candidate_index(candidates) == 1
|
|
|
|
|
|
def test_select_trigger_candidate_none_when_still_ambiguous() -> None:
|
|
candidates = [
|
|
("Generic PnP Monitor #1", 15),
|
|
("Generic PnP Monitor #2", 19),
|
|
]
|
|
assert _select_trigger_candidate_index(candidates) is None
|