mirror of
https://github.com/esphome/esphome.git
synced 2026-10-03 17:55:57 +00:00
[cpptests] support testing platform components (#13075)
Co-authored-by: J. Nick Koston <nick@home-assistant.io> Co-authored-by: J. Nick Koston <nick@koston.org>
This commit is contained in:
co-authored by
J. Nick Koston
J. Nick Koston
parent
00f809f5f0
commit
e82f0f4432
@@ -841,6 +841,18 @@ class TestEsphomeCore:
|
||||
|
||||
assert "WiFi" in target.platformio_libraries
|
||||
|
||||
def test_testing_ensure_platform_registered__sets_count(self, target):
|
||||
"""Test testing_ensure_platform_registered sets count to 1 for new platform."""
|
||||
assert target.platform_counts["sensor"] == 0
|
||||
target.testing_ensure_platform_registered("sensor")
|
||||
assert target.platform_counts["sensor"] == 1
|
||||
|
||||
def test_testing_ensure_platform_registered__does_not_overwrite(self, target):
|
||||
"""Test testing_ensure_platform_registered preserves existing count."""
|
||||
target.platform_counts["sensor"] = 3
|
||||
target.testing_ensure_platform_registered("sensor")
|
||||
assert target.platform_counts["sensor"] == 3
|
||||
|
||||
def test_add_library__extracts_short_name_from_path(self, target):
|
||||
"""Test add_library extracts short name from library paths like owner/lib."""
|
||||
target.data[const.KEY_CORE] = {
|
||||
|
||||
Reference in New Issue
Block a user