Skip to content

Commit

Permalink
Add more sending benchmarks (#1053)
Browse files Browse the repository at this point in the history
  • Loading branch information
bdraco authored Feb 2, 2025
1 parent 9e03aa0 commit ab15d7b
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion tests/benchmarks/test_requests.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from aioesphomeapi.client import APIClient


def test_sending_request(
def test_sending_light_command_request_with_bool(
benchmark: BenchmarkFixture,
api_client: tuple[
APIClient, APIConnection, asyncio.Transport, APIPlaintextFrameHelper
Expand All @@ -22,3 +22,18 @@ def test_sending_request(
@benchmark
def send_request():
client.light_command(1, True)


def test_sending_empty_light_command_request(
benchmark: BenchmarkFixture,
api_client: tuple[
APIClient, APIConnection, asyncio.Transport, APIPlaintextFrameHelper
],
) -> None:
client, connection, transport, protocol = api_client

connection._frame_helper._writelines = lambda lines: None

@benchmark
def send_request():
client.light_command(1)

0 comments on commit ab15d7b

Please sign in to comment.