Remove homeassistant.remote (#16099)

* Remove homeassistant.remote

* Use direct import for API

* Fix docstring
This commit is contained in:
Paulus Schoutsen 2018-08-21 15:49:58 +02:00 committed by GitHub
parent ae5c4c7e13
commit 7bb5344942
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
18 changed files with 62 additions and 555 deletions

View file

@ -0,0 +1,21 @@
"""Test Home Assistant remote methods and classes."""
import pytest
from homeassistant import core
from homeassistant.helpers.json import JSONEncoder
from homeassistant.util import dt as dt_util
def test_json_encoder(hass):
"""Test the JSON Encoder."""
ha_json_enc = JSONEncoder()
state = core.State('test.test', 'hello')
assert ha_json_enc.default(state) == state.as_dict()
# Default method raises TypeError if non HA object
with pytest.raises(TypeError):
ha_json_enc.default(1)
now = dt_util.utcnow()
assert ha_json_enc.default(now) == now.isoformat()