Skip to content
This repository has been archived by the owner on Sep 4, 2024. It is now read-only.

Commit

Permalink
black
Browse files Browse the repository at this point in the history
  • Loading branch information
Shulyaka committed Jul 25, 2024
1 parent 1442da8 commit a64b864
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 25 deletions.
1 change: 0 additions & 1 deletion custom_components/anthropic/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
from __future__ import annotations

import anthropic

from homeassistant.config_entries import ConfigEntry
from homeassistant.const import CONF_API_KEY, Platform
from homeassistant.core import HomeAssistant
Expand Down
1 change: 0 additions & 1 deletion custom_components/anthropic/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

import anthropic
import voluptuous as vol

from homeassistant.config_entries import (
ConfigEntry,
ConfigFlow,
Expand Down
7 changes: 3 additions & 4 deletions custom_components/anthropic/conversation.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
"""Conversation support for Anthropic."""

from collections.abc import Callable
import json
from collections.abc import Callable
from typing import Any, Literal, cast

import anthropic
import voluptuous as vol
from anthropic._types import NOT_GIVEN
from anthropic.types import (
Message,
Expand All @@ -16,9 +17,6 @@
ToolUseBlock,
ToolUseBlockParam,
)
import voluptuous as vol
from voluptuous_openapi import convert

from homeassistant.components import assist_pipeline, conversation
from homeassistant.components.conversation import trace
from homeassistant.const import CONF_LLM_HASS_API, MATCH_ALL
Expand All @@ -27,6 +25,7 @@
from homeassistant.helpers import device_registry as dr, intent, llm, template
from homeassistant.helpers.entity_platform import AddEntitiesCallback
from homeassistant.util import ulid
from voluptuous_openapi import convert

from . import AnthropicConfigEntry
from .const import (
Expand Down
3 changes: 0 additions & 3 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,12 @@
from unittest.mock import AsyncMock, patch

import pytest

from homeassistant.const import CONF_LLM_HASS_API
from homeassistant.core import HomeAssistant
from homeassistant.helpers import llm
from homeassistant.setup import async_setup_component

from pytest_homeassistant_custom_component.common import MockConfigEntry


pytest_plugins = "pytest_homeassistant_custom_component"


Expand Down
13 changes: 6 additions & 7 deletions tests/test_config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

from unittest.mock import AsyncMock, patch

import pytest
from anthropic import (
APIConnectionError,
APIResponseValidationError,
Expand All @@ -10,10 +11,13 @@
BadRequestError,
InternalServerError,
)
from homeassistant import config_entries
from homeassistant.const import CONF_LLM_HASS_API
from homeassistant.core import HomeAssistant
from homeassistant.data_entry_flow import FlowResultType
from httpx import URL, Request, Response
import pytest
from pytest_homeassistant_custom_component.common import MockConfigEntry

from homeassistant import config_entries
from custom_components.anthropic.config_flow import RECOMMENDED_OPTIONS
from custom_components.anthropic.const import (
CONF_CHAT_MODEL,
Expand All @@ -25,11 +29,6 @@
RECOMMENDED_CHAT_MODEL,
RECOMMENDED_MAX_TOKENS,
)
from homeassistant.const import CONF_LLM_HASS_API
from homeassistant.core import HomeAssistant
from homeassistant.data_entry_flow import FlowResultType

from pytest_homeassistant_custom_component.common import MockConfigEntry


def test_test(hass):
Expand Down
8 changes: 3 additions & 5 deletions tests/test_conversation.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,10 @@

from unittest.mock import AsyncMock, Mock, patch

import voluptuous as vol
from anthropic import RateLimitError
from anthropic.types import Message, TextBlock, ToolUseBlock, Usage
from freezegun import freeze_time
from httpx import URL, Request, Response
from syrupy.assertion import SnapshotAssertion
import voluptuous as vol

from homeassistant.components import conversation
from homeassistant.components.conversation import trace
from homeassistant.const import CONF_LLM_HASS_API
Expand All @@ -17,8 +14,9 @@
from homeassistant.helpers import intent, llm
from homeassistant.setup import async_setup_component
from homeassistant.util import ulid

from httpx import URL, Request, Response
from pytest_homeassistant_custom_component.common import MockConfigEntry
from syrupy.assertion import SnapshotAssertion


def test_test(hass):
Expand Down
6 changes: 2 additions & 4 deletions tests/test_init.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,16 @@

from unittest.mock import AsyncMock, patch

import pytest
from anthropic import (
APIConnectionError,
APITimeoutError,
AuthenticationError,
BadRequestError,
)
from httpx import URL, Request, Response
import pytest

from homeassistant.core import HomeAssistant
from homeassistant.setup import async_setup_component

from httpx import URL, Request, Response
from pytest_homeassistant_custom_component.common import MockConfigEntry


Expand Down

0 comments on commit a64b864

Please sign in to comment.