Black
This commit is contained in:
parent
da05dfe708
commit
4de97abc3a
2676 changed files with 163166 additions and 140084 deletions
|
@ -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."""
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue