-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add HomeWizardEnergy base class which is implemented in v1 and v2
- Loading branch information
Showing
6 changed files
with
116 additions
and
147 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
"""Test the base class.""" | ||
|
||
import pytest | ||
|
||
from homewizard_energy.homewizard_energy import HomeWizardEnergy | ||
|
||
pytestmark = [pytest.mark.asyncio] | ||
|
||
|
||
@pytest.mark.parametrize( | ||
("function"), | ||
[ | ||
("device"), | ||
("measurement"), | ||
("system"), | ||
("state"), | ||
("identify"), | ||
("reboot"), | ||
], | ||
) | ||
async def test_base_class_raises_notimplementederror(function: str): | ||
"""Test the base class raises NotImplementedError.""" | ||
with pytest.raises(NotImplementedError): | ||
async with HomeWizardEnergy("host") as api: | ||
await getattr(api, function)() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.