-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_init.py
More file actions
30 lines (22 loc) · 935 Bytes
/
test_init.py
File metadata and controls
30 lines (22 loc) · 935 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
"""Test the Example Integration init module."""
from homeassistant.const import Platform
from custom_components.example_integration import (
PLATFORMS,
async_setup_entry,
async_unload_entry,
)
async def test_async_setup_entry_not_implemented() -> None:
"""Test that async_setup_entry is implemented."""
# This test ensures the integration can be imported without errors
assert async_setup_entry is not None
assert callable(async_setup_entry)
async def test_async_unload_entry_not_implemented() -> None:
"""Test that async_unload_entry is implemented."""
# This test ensures the unload function exists
assert async_unload_entry is not None
assert callable(async_unload_entry)
async def test_platforms_defined() -> None:
"""Test that platforms are properly defined."""
assert PLATFORMS is not None
assert isinstance(PLATFORMS, list)
assert Platform.SENSOR in PLATFORMS