| 1 |
from pytest_codspeed import BenchmarkFixture |
| 2 |
|
| 3 |
from bluetooth_data_tools import human_readable_name |
| 4 |
|
| 5 |
|
| 6 |
|
| 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)) |