Remove crazy JSON encoding things that are no longer used (#13029)

Catch JSON encoding errors in HTTP view
This commit is contained in:
Paulus Schoutsen authored and Fabian Affolter committed 2018-03-12 23:22:08 +01:00
1 parent ae286a550b
commit 0a2e949e0a
4 files changed
+28 -15

No files matched your search

+15
View File
@@ -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