This commit is contained in:
Paulus Schoutsen 2019-07-31 12:25:30 -07:00
parent da05dfe708
commit 4de97abc3a
2676 changed files with 163166 additions and 140084 deletions

View file

@ -8,8 +8,7 @@ from tempfile import mkdtemp
import pytest
from homeassistant.util.json import (
SerializationError, load_json, save_json)
from homeassistant.util.json import SerializationError, load_json, save_json
from homeassistant.exceptions import HomeAssistantError
@ -37,7 +36,7 @@ def teardown():
def _path_for(leaf_name):
return os.path.join(TMP_DIR, leaf_name+".json")
return os.path.join(TMP_DIR, leaf_name + ".json")
def test_save_and_load():
@ -49,8 +48,9 @@ def test_save_and_load():
# Skipped on Windows
@unittest.skipIf(sys.platform.startswith('win'),
"private permissions not supported on Windows")
@unittest.skipIf(
sys.platform.startswith("win"), "private permissions not supported on Windows"
)
def test_save_and_load_private():
"""Test we can load private files and that they are protected."""
fname = _path_for("test2")
@ -88,6 +88,7 @@ def test_load_bad_data():
def test_custom_encoder():
"""Test serializing with a custom encoder."""
class MockJSONEncoder(JSONEncoder):
"""Mock JSON encoder."""