Remove crazy JSON encoding things that are no longer used (#13029)
Catch JSON encoding errors in HTTP view
This commit is contained in:
1 parent
ae286a550b
commit
0a2e949e0a
4 files changed
+28
-15
No files matched your search
@@ -0,0 +1,15 @@
|
||||
"""Tests for Home Assistant View."""
|
||||
from aiohttp.web_exceptions import HTTPInternalServerError
|
||||
import pytest
|
||||
|
||||
from homeassistant.components.http.view import HomeAssistantView
|
||||
|
||||
|
||||
async def test_invalid_json(caplog):
|
||||
"""Test trying to return invalid JSON."""
|
||||
view = HomeAssistantView()
|
||||
|
||||
with pytest.raises(HTTPInternalServerError):
|
||||
view.json(object)
|
||||
|
||||
assert str(object) in caplog.text
|
||||
Reference in new issue
Block a user