1
0
mirror of https://github.com/home-assistant/supervisor.git synced 2025-12-24 12:29:08 +00:00

Fix network API default value & tests (#2234)

This commit is contained in:
Pascal Vizeli
2020-11-10 15:08:35 +01:00
committed by GitHub
parent edc8d8960f
commit 9264d437b1
5 changed files with 52 additions and 4 deletions

View File

@@ -99,6 +99,37 @@ async def test_api_network_interface_update(api_client):
assert result["result"] == "ok"
@pytest.mark.asyncio
async def test_api_network_interface_update_wifi(api_client):
"""Test network manager api."""
resp = await api_client.post(
f"/network/interface/{TEST_INTERFACE_WLAN}/update",
json={
"enabled": True,
"ipv4": {
"method": "static",
"nameservers": ["1.1.1.1"],
"address": ["192.168.2.148/24"],
"gateway": "192.168.1.1",
},
"wifi": {"ssid": "MY_TEST", "auth": "wpa-psk", "psk": "myWifiPassword"},
},
)
result = await resp.json()
assert result["result"] == "ok"
@pytest.mark.asyncio
async def test_api_network_interface_update_remove(api_client):
"""Test network manager api."""
resp = await api_client.post(
f"/network/interface/{TEST_INTERFACE}/update",
json={"enabled": False},
)
result = await resp.json()
assert result["result"] == "ok"
@pytest.mark.asyncio
async def test_api_network_interface_info_invalid(api_client):
"""Test network manager api."""