Skip to content

Commit

Permalink
adding tests to fix coverage and touch new code
Browse files Browse the repository at this point in the history
  • Loading branch information
brew-your-own committed Mar 16, 2024
1 parent c9a4e0e commit 52b2a91
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions tests/test_discovery.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,19 @@ async def test_discovery(inverters_fixture):
assert rt_api.inverter.__class__ == inverter_class


@pytest.mark.asyncio
async def test_discovery_with_model(inverters_fixture):
conn, inverter_class, _ = inverters_fixture
rt_api = await solax.real_time_api(*conn, "", inverter_class.__name__)
assert rt_api.inverter.__class__ == inverter_class


@pytest.mark.asyncio
async def test_discovery_unsupported_inverter():
with pytest.raises(DiscoveryError):
await solax.real_time_api("localhost", 2, "", "doesnotexist")


@pytest.mark.asyncio
async def test_discovery_no_host():
with pytest.raises(DiscoveryError):
Expand Down

0 comments on commit 52b2a91

Please sign in to comment.