Debian Codegraph @

tests/benchmarks/test_human_readable_name.py

raw symbols SCIP
1 from pytest_codspeed import BenchmarkFixture
2
3 from bluetooth_data_tools import human_readable_name
4
5 # Realistic scan shape: a known peripheral with a name plus a fresh
6 # adv carrying only a local_name, both keyed by a hex BLE address.
7 _NAME = "Living Room Sensor"
8 _LOCAL_NAME = "RZSS"
9 _ADDRESS = "AA:BB:CC:DD:EE:FF"
10
11
12 def test_human_readable_name_with_name(benchmark: BenchmarkFixture) -> None:
13 benchmark(lambda: human_readable_name(_NAME, _LOCAL_NAME, _ADDRESS))
14
15
16 def test_human_readable_name_local_only(benchmark: BenchmarkFixture) -> None:
17 benchmark(lambda: human_readable_name(None, _LOCAL_NAME, _ADDRESS))