Sort imports according to PEP8 for recorder (#29652)
This commit is contained in:
1 parent
b832749e3c
commit
3d64405896
10 files changed
+25
-22
No files matched your search
@@ -4,8 +4,8 @@ This file contains the original models definitions before schema tracking was
|
||||
implemented. It is used to test the schema migration logic.
|
||||
"""
|
||||
|
||||
import json
|
||||
from datetime import datetime
|
||||
import json
|
||||
import logging
|
||||
|
||||
from sqlalchemy import (
|
||||
@@ -21,9 +21,9 @@ from sqlalchemy import (
|
||||
)
|
||||
from sqlalchemy.ext.declarative import declarative_base
|
||||
|
||||
import homeassistant.util.dt as dt_util
|
||||
from homeassistant.core import Event, EventOrigin, State, split_entity_id
|
||||
from homeassistant.helpers.json import JSONEncoder
|
||||
import homeassistant.util.dt as dt_util
|
||||
|
||||
# SQLAlchemy Schema
|
||||
# pylint: disable=invalid-name
|
||||
|
||||
@@ -5,13 +5,13 @@ from unittest.mock import patch
|
||||
|
||||
import pytest
|
||||
|
||||
from homeassistant.core import callback
|
||||
from homeassistant.const import MATCH_ALL
|
||||
from homeassistant.setup import async_setup_component
|
||||
from homeassistant.components.recorder import Recorder
|
||||
from homeassistant.components.recorder.const import DATA_INSTANCE
|
||||
from homeassistant.components.recorder.models import Events, States
|
||||
from homeassistant.components.recorder.util import session_scope
|
||||
from homeassistant.components.recorder.models import States, Events
|
||||
from homeassistant.const import MATCH_ALL
|
||||
from homeassistant.core import callback
|
||||
from homeassistant.setup import async_setup_component
|
||||
|
||||
from tests.common import get_test_home_assistant, init_recorder_component
|
||||
|
||||
|
||||
@@ -1,13 +1,14 @@
|
||||
"""The tests for the Recorder component."""
|
||||
# pylint: disable=protected-access
|
||||
from unittest.mock import patch, call
|
||||
from unittest.mock import call, patch
|
||||
|
||||
import pytest
|
||||
from sqlalchemy import create_engine
|
||||
from sqlalchemy.pool import StaticPool
|
||||
|
||||
from homeassistant.bootstrap import async_setup_component
|
||||
from homeassistant.components.recorder import migration, const, models
|
||||
from homeassistant.components.recorder import const, migration, models
|
||||
|
||||
from tests.components.recorder import models_original
|
||||
|
||||
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
"""The tests for the Recorder component."""
|
||||
import unittest
|
||||
from datetime import datetime
|
||||
import unittest
|
||||
|
||||
from sqlalchemy import create_engine
|
||||
from sqlalchemy.orm import scoped_session, sessionmaker
|
||||
|
||||
import homeassistant.core as ha
|
||||
from homeassistant.components.recorder.models import Base, Events, RecorderRuns, States
|
||||
from homeassistant.const import EVENT_STATE_CHANGED
|
||||
import homeassistant.core as ha
|
||||
from homeassistant.util import dt
|
||||
from homeassistant.components.recorder.models import Base, Events, States, RecorderRuns
|
||||
|
||||
ENGINE = None
|
||||
SESSION = None
|
||||
|
||||
@@ -1,14 +1,15 @@
|
||||
"""Test data purging."""
|
||||
import json
|
||||
from datetime import datetime, timedelta
|
||||
import json
|
||||
import unittest
|
||||
from unittest.mock import patch
|
||||
|
||||
from homeassistant.components import recorder
|
||||
from homeassistant.components.recorder.const import DATA_INSTANCE
|
||||
from homeassistant.components.recorder.models import Events, States
|
||||
from homeassistant.components.recorder.purge import purge_old_data
|
||||
from homeassistant.components.recorder.models import States, Events
|
||||
from homeassistant.components.recorder.util import session_scope
|
||||
|
||||
from tests.common import get_test_home_assistant, init_recorder_component
|
||||
|
||||
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
"""Test util methods."""
|
||||
from unittest.mock import patch, MagicMock
|
||||
from unittest.mock import MagicMock, patch
|
||||
|
||||
import pytest
|
||||
|
||||
from homeassistant.components.recorder import util
|
||||
from homeassistant.components.recorder.const import DATA_INSTANCE
|
||||
|
||||
from tests.common import get_test_home_assistant, init_recorder_component
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user