Sort imports according to PEP8 for 'tests' (#29791)
This commit is contained in:
1 parent
67c56c860d
commit
f60125b5c9
68 files changed
+254
-251
No files matched your search
@@ -1,8 +1,8 @@
|
||||
"""Tests for async util methods from Python source."""
|
||||
import asyncio
|
||||
import sys
|
||||
from unittest.mock import MagicMock, patch
|
||||
from unittest import TestCase
|
||||
from unittest.mock import MagicMock, patch
|
||||
|
||||
import pytest
|
||||
|
||||
|
||||
@@ -2,13 +2,13 @@
|
||||
|
||||
import pytest
|
||||
|
||||
import homeassistant.util.distance as distance_util
|
||||
from homeassistant.const import (
|
||||
LENGTH_FEET,
|
||||
LENGTH_KILOMETERS,
|
||||
LENGTH_METERS,
|
||||
LENGTH_FEET,
|
||||
LENGTH_MILES,
|
||||
)
|
||||
import homeassistant.util.distance as distance_util
|
||||
|
||||
INVALID_SYMBOL = "bob"
|
||||
VALID_SYMBOL = LENGTH_KILOMETERS
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
"""Test Home Assistant util methods."""
|
||||
from unittest.mock import patch, MagicMock
|
||||
from datetime import datetime, timedelta
|
||||
from unittest.mock import MagicMock, patch
|
||||
|
||||
import pytest
|
||||
|
||||
|
||||
@@ -1,16 +1,15 @@
|
||||
"""Test Home Assistant json utility functions."""
|
||||
from json import JSONEncoder
|
||||
import os
|
||||
import unittest
|
||||
from unittest.mock import Mock
|
||||
import sys
|
||||
from tempfile import mkdtemp
|
||||
import unittest
|
||||
from unittest.mock import Mock
|
||||
|
||||
import pytest
|
||||
|
||||
from homeassistant.util.json import SerializationError, load_json, save_json
|
||||
from homeassistant.exceptions import HomeAssistantError
|
||||
|
||||
from homeassistant.util.json import SerializationError, load_json, save_json
|
||||
|
||||
# Test data that can be saved as JSON
|
||||
TEST_JSON_A = {"a": 1, "B": "two"}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
"""Test Home Assistant location util methods."""
|
||||
from unittest.mock import patch, Mock
|
||||
from unittest.mock import Mock, patch
|
||||
|
||||
import aiohttp
|
||||
import pytest
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
import asyncio
|
||||
import logging
|
||||
import os
|
||||
import sys
|
||||
from subprocess import PIPE
|
||||
import sys
|
||||
from unittest.mock import MagicMock, call, patch
|
||||
|
||||
import pkg_resources
|
||||
@@ -11,7 +11,6 @@ import pytest
|
||||
|
||||
import homeassistant.util.package as package
|
||||
|
||||
|
||||
RESOURCE_DIR = os.path.abspath(
|
||||
os.path.join(os.path.dirname(__file__), "..", "resources")
|
||||
)
|
||||
|
||||
@@ -2,10 +2,10 @@
|
||||
import pytest
|
||||
|
||||
from homeassistant.const import (
|
||||
PRESSURE_PA,
|
||||
PRESSURE_HPA,
|
||||
PRESSURE_MBAR,
|
||||
PRESSURE_INHG,
|
||||
PRESSURE_MBAR,
|
||||
PRESSURE_PA,
|
||||
PRESSURE_PSI,
|
||||
)
|
||||
import homeassistant.util.pressure as pressure_util
|
||||
|
||||
@@ -1,14 +1,13 @@
|
||||
"""Test Home Assistant ruamel.yaml loader."""
|
||||
import os
|
||||
from tempfile import mkdtemp
|
||||
import pytest
|
||||
|
||||
import pytest
|
||||
from ruamel.yaml import YAML
|
||||
|
||||
from homeassistant.exceptions import HomeAssistantError
|
||||
import homeassistant.util.ruamel_yaml as util_yaml
|
||||
|
||||
|
||||
TEST_YAML_A = """\
|
||||
title: My Awesome Home
|
||||
# Include external resources
|
||||
|
||||
@@ -1,20 +1,20 @@
|
||||
"""Test the unit system helper."""
|
||||
import pytest
|
||||
|
||||
from homeassistant.util.unit_system import UnitSystem, METRIC_SYSTEM, IMPERIAL_SYSTEM
|
||||
from homeassistant.const import (
|
||||
LENGTH_METERS,
|
||||
LENGTH_KILOMETERS,
|
||||
MASS_GRAMS,
|
||||
PRESSURE_PA,
|
||||
VOLUME_LITERS,
|
||||
TEMP_CELSIUS,
|
||||
LENGTH,
|
||||
LENGTH_KILOMETERS,
|
||||
LENGTH_METERS,
|
||||
MASS,
|
||||
MASS_GRAMS,
|
||||
PRESSURE,
|
||||
PRESSURE_PA,
|
||||
TEMP_CELSIUS,
|
||||
TEMPERATURE,
|
||||
VOLUME,
|
||||
VOLUME_LITERS,
|
||||
)
|
||||
from homeassistant.util.unit_system import IMPERIAL_SYSTEM, METRIC_SYSTEM, UnitSystem
|
||||
|
||||
SYSTEM_NAME = "TEST"
|
||||
INVALID_UNIT = "INVALID"
|
||||
|
||||
@@ -2,13 +2,13 @@
|
||||
|
||||
import pytest
|
||||
|
||||
import homeassistant.util.volume as volume_util
|
||||
from homeassistant.const import (
|
||||
VOLUME_FLUID_OUNCE,
|
||||
VOLUME_GALLONS,
|
||||
VOLUME_LITERS,
|
||||
VOLUME_MILLILITERS,
|
||||
VOLUME_GALLONS,
|
||||
VOLUME_FLUID_OUNCE,
|
||||
)
|
||||
import homeassistant.util.volume as volume_util
|
||||
|
||||
INVALID_SYMBOL = "bob"
|
||||
VALID_SYMBOL = VOLUME_LITERS
|
||||
|
||||
@@ -1,16 +1,17 @@
|
||||
"""Test Home Assistant yaml loader."""
|
||||
import io
|
||||
import logging
|
||||
import os
|
||||
import unittest
|
||||
import logging
|
||||
from unittest.mock import patch
|
||||
|
||||
import pytest
|
||||
|
||||
from homeassistant.exceptions import HomeAssistantError
|
||||
from homeassistant.util.yaml import loader as yaml_loader
|
||||
import homeassistant.util.yaml as yaml
|
||||
from homeassistant.config import YAML_CONFIG_FILE, load_yaml_config_file
|
||||
from homeassistant.exceptions import HomeAssistantError
|
||||
import homeassistant.util.yaml as yaml
|
||||
from homeassistant.util.yaml import loader as yaml_loader
|
||||
|
||||
from tests.common import get_test_config_dir, patch_yaml_files
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user