Skip to content

Commit

Permalink
🔨 Update the tests
Browse files Browse the repository at this point in the history
I think this makes it a bit clearer what the test stands for.
  • Loading branch information
klaasnicolaas committed Feb 13, 2022
1 parent 0e10034 commit 50e2aab
Showing 1 changed file with 15 additions and 17 deletions.
32 changes: 15 additions & 17 deletions tests/test_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,8 @@ async def test_device_html(aresponses):


@pytest.mark.asyncio
async def test_inverter_html_solis(aresponses):
"""Test request from a Inverter - HTML source."""
async def test_inverter_without_session(aresponses):
"""Test request from a Inverter - HTML source and without session"""
aresponses.add(
"example.com",
"/status.html",
Expand Down Expand Up @@ -155,8 +155,8 @@ async def test_inverter_html_solis(aresponses):


@pytest.mark.asyncio
async def test_device_html_solis(aresponses):
"""Test request from a Inverter - HTML source."""
async def test_device_without_session(aresponses):
"""Test request from a Inverter - HTML source and without session"""
aresponses.add(
"example.com",
"/status.html",
Expand All @@ -168,19 +168,17 @@ async def test_device_html_solis(aresponses):
),
)

async with aiohttp.ClientSession() as session:
client = OmnikInverter( # noqa: S106
host="example.com",
source_type="html",
username="klaas",
password="supercool",
session=session,
)
device: Device = await client.device()
assert device
assert device.signal_quality == 96
assert device.firmware == "MW_08_512_0501_1.82"
assert device.ip_address == "192.168.178.3"
client = OmnikInverter( # noqa: S106
host="example.com",
source_type="html",
username="klaas",
password="supercool",
)
device: Device = await client.device()
assert device
assert device.signal_quality == 96
assert device.firmware == "MW_08_512_0501_1.82"
assert device.ip_address == "192.168.178.3"


@pytest.mark.asyncio
Expand Down

0 comments on commit 50e2aab

Please sign in to comment.