Update emulated_hue to allow getting bridge config without username (#38986)
* Allow bridge config without username * Updated emulated_hue tests * Test cleanup
This commit is contained in:
1 parent
1af6c04111
commit
1505343b4b
3 files changed
+21
-5
No files matched your search
@@ -467,6 +467,24 @@ async def test_discover_config(hue_client):
|
||||
assert "linkbutton" in config_json
|
||||
assert config_json["linkbutton"] is True
|
||||
|
||||
# Test without username
|
||||
result = await hue_client.get("/api/config")
|
||||
|
||||
assert result.status == 200
|
||||
assert "application/json" in result.headers["content-type"]
|
||||
|
||||
config_json = await result.json()
|
||||
assert "error" not in config_json
|
||||
|
||||
# Test with wrong username username
|
||||
result = await hue_client.get("/api/wronguser/config")
|
||||
|
||||
assert result.status == 200
|
||||
assert "application/json" in result.headers["content-type"]
|
||||
|
||||
config_json = await result.json()
|
||||
assert "error" not in config_json
|
||||
|
||||
|
||||
async def test_get_light_state(hass_hue, hue_client):
|
||||
"""Test the getting of light state."""
|
||||
@@ -1177,7 +1195,6 @@ async def test_unauthorized_user_blocked(hue_client):
|
||||
"""Test unauthorized_user blocked."""
|
||||
getUrls = [
|
||||
"/api/wronguser",
|
||||
"/api/wronguser/config",
|
||||
]
|
||||
for getUrl in getUrls:
|
||||
result = await hue_client.get(getUrl)
|
||||
|
||||
Reference in new issue
Block a user