repo
stringlengths
7
90
file_url
stringlengths
81
315
file_path
stringlengths
4
228
content
stringlengths
0
32.8k
language
stringclasses
1 value
license
stringclasses
7 values
commit_sha
stringlengths
40
40
retrieved_at
stringdate
2026-01-04 14:38:15
2026-01-05 02:33:18
truncated
bool
2 classes
RVC-Project/Retrieval-based-Voice-Conversion-WebUI
https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI/blob/7ef19867780cf703841ebafb565a4e47d1ea86ff/infer/lib/uvr5_pack/lib_v5/layers_537227KB.py
infer/lib/uvr5_pack/lib_v5/layers_537227KB.py
import torch import torch.nn.functional as F from torch import nn from . import spec_utils class Conv2DBNActiv(nn.Module): def __init__(self, nin, nout, ksize=3, stride=1, pad=1, dilation=1, activ=nn.ReLU): super(Conv2DBNActiv, self).__init__() self.conv = nn.Sequential( nn.Conv2d( ...
python
MIT
7ef19867780cf703841ebafb565a4e47d1ea86ff
2026-01-04T14:42:38.476132Z
false
RVC-Project/Retrieval-based-Voice-Conversion-WebUI
https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI/blob/7ef19867780cf703841ebafb565a4e47d1ea86ff/infer/lib/uvr5_pack/lib_v5/nets_123812KB.py
infer/lib/uvr5_pack/lib_v5/nets_123812KB.py
import torch import torch.nn.functional as F from torch import nn from . import layers_123821KB as layers class BaseASPPNet(nn.Module): def __init__(self, nin, ch, dilations=(4, 8, 16)): super(BaseASPPNet, self).__init__() self.enc1 = layers.Encoder(nin, ch, 3, 2, 1) self.enc2 = layers.En...
python
MIT
7ef19867780cf703841ebafb565a4e47d1ea86ff
2026-01-04T14:42:38.476132Z
false
RVC-Project/Retrieval-based-Voice-Conversion-WebUI
https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI/blob/7ef19867780cf703841ebafb565a4e47d1ea86ff/infer/lib/uvr5_pack/lib_v5/nets.py
infer/lib/uvr5_pack/lib_v5/nets.py
import layers import torch import torch.nn.functional as F from torch import nn from . import spec_utils class BaseASPPNet(nn.Module): def __init__(self, nin, ch, dilations=(4, 8, 16)): super(BaseASPPNet, self).__init__() self.enc1 = layers.Encoder(nin, ch, 3, 2, 1) self.enc2 = layers.Enc...
python
MIT
7ef19867780cf703841ebafb565a4e47d1ea86ff
2026-01-04T14:42:38.476132Z
false
RVC-Project/Retrieval-based-Voice-Conversion-WebUI
https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI/blob/7ef19867780cf703841ebafb565a4e47d1ea86ff/infer/lib/uvr5_pack/lib_v5/nets_537238KB.py
infer/lib/uvr5_pack/lib_v5/nets_537238KB.py
import numpy as np import torch import torch.nn.functional as F from torch import nn from . import layers_537238KB as layers class BaseASPPNet(nn.Module): def __init__(self, nin, ch, dilations=(4, 8, 16)): super(BaseASPPNet, self).__init__() self.enc1 = layers.Encoder(nin, ch, 3, 2, 1) se...
python
MIT
7ef19867780cf703841ebafb565a4e47d1ea86ff
2026-01-04T14:42:38.476132Z
false
RVC-Project/Retrieval-based-Voice-Conversion-WebUI
https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI/blob/7ef19867780cf703841ebafb565a4e47d1ea86ff/infer/lib/uvr5_pack/lib_v5/nets_123821KB.py
infer/lib/uvr5_pack/lib_v5/nets_123821KB.py
import torch import torch.nn.functional as F from torch import nn from . import layers_123821KB as layers class BaseASPPNet(nn.Module): def __init__(self, nin, ch, dilations=(4, 8, 16)): super(BaseASPPNet, self).__init__() self.enc1 = layers.Encoder(nin, ch, 3, 2, 1) self.enc2 = layers.En...
python
MIT
7ef19867780cf703841ebafb565a4e47d1ea86ff
2026-01-04T14:42:38.476132Z
false
RVC-Project/Retrieval-based-Voice-Conversion-WebUI
https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI/blob/7ef19867780cf703841ebafb565a4e47d1ea86ff/infer/lib/uvr5_pack/lib_v5/layers_537238KB.py
infer/lib/uvr5_pack/lib_v5/layers_537238KB.py
import torch import torch.nn.functional as F from torch import nn from . import spec_utils class Conv2DBNActiv(nn.Module): def __init__(self, nin, nout, ksize=3, stride=1, pad=1, dilation=1, activ=nn.ReLU): super(Conv2DBNActiv, self).__init__() self.conv = nn.Sequential( nn.Conv2d( ...
python
MIT
7ef19867780cf703841ebafb565a4e47d1ea86ff
2026-01-04T14:42:38.476132Z
false
RVC-Project/Retrieval-based-Voice-Conversion-WebUI
https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI/blob/7ef19867780cf703841ebafb565a4e47d1ea86ff/infer/lib/uvr5_pack/lib_v5/nets_33966KB.py
infer/lib/uvr5_pack/lib_v5/nets_33966KB.py
import torch import torch.nn.functional as F from torch import nn from . import layers_33966KB as layers class BaseASPPNet(nn.Module): def __init__(self, nin, ch, dilations=(4, 8, 16, 32)): super(BaseASPPNet, self).__init__() self.enc1 = layers.Encoder(nin, ch, 3, 2, 1) self.enc2 = layers...
python
MIT
7ef19867780cf703841ebafb565a4e47d1ea86ff
2026-01-04T14:42:38.476132Z
false
RVC-Project/Retrieval-based-Voice-Conversion-WebUI
https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI/blob/7ef19867780cf703841ebafb565a4e47d1ea86ff/infer/lib/uvr5_pack/lib_v5/layers.py
infer/lib/uvr5_pack/lib_v5/layers.py
import torch import torch.nn.functional as F from torch import nn from . import spec_utils class Conv2DBNActiv(nn.Module): def __init__(self, nin, nout, ksize=3, stride=1, pad=1, dilation=1, activ=nn.ReLU): super(Conv2DBNActiv, self).__init__() self.conv = nn.Sequential( nn.Conv2d( ...
python
MIT
7ef19867780cf703841ebafb565a4e47d1ea86ff
2026-01-04T14:42:38.476132Z
false
RVC-Project/Retrieval-based-Voice-Conversion-WebUI
https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI/blob/7ef19867780cf703841ebafb565a4e47d1ea86ff/configs/config.py
configs/config.py
import argparse import os import sys import json import shutil from multiprocessing import cpu_count import torch try: import intel_extension_for_pytorch as ipex # pylint: disable=import-error, unused-import if torch.xpu.is_available(): from infer.modules.ipex import ipex_init ipex_init() e...
python
MIT
7ef19867780cf703841ebafb565a4e47d1ea86ff
2026-01-04T14:42:38.476132Z
false
home-assistant/core
https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/test_loader.py
tests/test_loader.py
"""Test to verify that we can load components.""" import asyncio import os import pathlib import sys import threading from typing import Any from unittest.mock import MagicMock, patch from awesomeversion import AwesomeVersion import pytest from homeassistant import loader from homeassistant.components import hue fro...
python
Apache-2.0
6cae1821fb77e785a8aebb48dfc72ea5081b8975
2026-01-04T14:38:15.504802Z
true
home-assistant/core
https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/typing.py
tests/typing.py
"""Typing helpers for Home Assistant tests.""" from __future__ import annotations from collections.abc import Callable, Coroutine from contextlib import AbstractAsyncContextManager from typing import TYPE_CHECKING, Any from unittest.mock import MagicMock from aiohttp import ClientWebSocketResponse from aiohttp.test_...
python
Apache-2.0
6cae1821fb77e785a8aebb48dfc72ea5081b8975
2026-01-04T14:38:15.504802Z
false
home-assistant/core
https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/test_requirements.py
tests/test_requirements.py
"""Test requirements module.""" import asyncio import logging import os from unittest.mock import call, patch import pytest from homeassistant import loader, setup from homeassistant.core import HomeAssistant from homeassistant.loader import async_get_integration from homeassistant.requirements import ( CONSTRAI...
python
Apache-2.0
6cae1821fb77e785a8aebb48dfc72ea5081b8975
2026-01-04T14:38:15.504802Z
false
home-assistant/core
https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/test_core.py
tests/test_core.py
"""Test to verify that Home Assistant core works.""" from __future__ import annotations import array import asyncio from datetime import datetime, timedelta import functools import gc import logging import os import re import threading import time from typing import Any from unittest.mock import MagicMock, patch fro...
python
Apache-2.0
6cae1821fb77e785a8aebb48dfc72ea5081b8975
2026-01-04T14:38:15.504802Z
true
home-assistant/core
https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/common.py
tests/common.py
"""Test the helper method for writing tests.""" from __future__ import annotations import asyncio from collections.abc import ( AsyncGenerator, Callable, Coroutine, Generator, Iterable, Iterator, Mapping, Sequence, ) from contextlib import asynccontextmanager, contextmanager, suppress ...
python
Apache-2.0
6cae1821fb77e785a8aebb48dfc72ea5081b8975
2026-01-04T14:38:15.504802Z
true
home-assistant/core
https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/test_config.py
tests/test_config.py
"""Test config utils.""" import asyncio from collections import OrderedDict from collections.abc import Generator import contextlib import logging import os from pathlib import Path from unittest import mock from unittest.mock import AsyncMock, MagicMock, Mock, patch import pytest from syrupy.assertion import Snapsho...
python
Apache-2.0
6cae1821fb77e785a8aebb48dfc72ea5081b8975
2026-01-04T14:38:15.504802Z
true
home-assistant/core
https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/test_data_entry_flow.py
tests/test_data_entry_flow.py
"""Test the flow classes.""" import asyncio from collections.abc import Callable import dataclasses import logging from typing import Any from unittest.mock import AsyncMock, Mock, patch import pytest import voluptuous as vol from homeassistant import config_entries, data_entry_flow from homeassistant.core import Ev...
python
Apache-2.0
6cae1821fb77e785a8aebb48dfc72ea5081b8975
2026-01-04T14:38:15.504802Z
true
home-assistant/core
https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/test_main.py
tests/test_main.py
"""Test methods in __main__.""" from unittest.mock import PropertyMock, patch from homeassistant import __main__ as main from homeassistant.const import REQUIRED_PYTHON_VER, RESTART_EXIT_CODE @patch("sys.exit") def test_validate_python(mock_exit) -> None: """Test validate Python version method.""" with patc...
python
Apache-2.0
6cae1821fb77e785a8aebb48dfc72ea5081b8975
2026-01-04T14:38:15.504802Z
false
home-assistant/core
https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/test_backup_restore.py
tests/test_backup_restore.py
"""Test methods in backup_restore.""" from collections.abc import Generator import json from pathlib import Path import tarfile from typing import Any from unittest import mock import pytest from homeassistant import backup_restore from .common import get_test_config_dir @pytest.fixture(autouse=True) def remove_r...
python
Apache-2.0
6cae1821fb77e785a8aebb48dfc72ea5081b8975
2026-01-04T14:38:15.504802Z
false
home-assistant/core
https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/test_core_config.py
tests/test_core_config.py
"""Test core_config.""" import asyncio from collections import OrderedDict import copy import os from pathlib import Path from tempfile import TemporaryDirectory from typing import Any from unittest.mock import Mock, PropertyMock, patch import pytest from voluptuous import Invalid, MultipleInvalid from webrtc_models ...
python
Apache-2.0
6cae1821fb77e785a8aebb48dfc72ea5081b8975
2026-01-04T14:38:15.504802Z
true
home-assistant/core
https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/conftest.py
tests/conftest.py
"""Set up some common test helper things.""" from __future__ import annotations import asyncio from collections.abc import AsyncGenerator, Callable, Coroutine, Generator from contextlib import AsyncExitStack, asynccontextmanager, contextmanager import datetime import functools import gc import itertools import loggin...
python
Apache-2.0
6cae1821fb77e785a8aebb48dfc72ea5081b8975
2026-01-04T14:38:15.504802Z
true
home-assistant/core
https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/test_block_async_io.py
tests/test_block_async_io.py
"""Tests for async util methods from Python source.""" import contextlib import glob import importlib import os from pathlib import Path, PurePosixPath import ssl import time from typing import Any from unittest.mock import Mock, patch import pytest from homeassistant import block_async_io from homeassistant.core im...
python
Apache-2.0
6cae1821fb77e785a8aebb48dfc72ea5081b8975
2026-01-04T14:38:15.504802Z
false
home-assistant/core
https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/test_bootstrap.py
tests/test_bootstrap.py
"""Test the bootstrapping.""" import asyncio from collections.abc import Generator, Iterable import contextlib import glob import logging import os import sys from typing import Any from unittest.mock import AsyncMock, Mock, patch import pytest from homeassistant import bootstrap, config as config_util, core, loader...
python
Apache-2.0
6cae1821fb77e785a8aebb48dfc72ea5081b8975
2026-01-04T14:38:15.504802Z
true
home-assistant/core
https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/patch_time.py
tests/patch_time.py
"""Patch time related functions.""" from __future__ import annotations import datetime import time import freezegun def ha_datetime_to_fakedatetime(datetime) -> freezegun.api.FakeDatetime: # type: ignore[name-defined] """Convert datetime to FakeDatetime. Modified to include https://github.com/spulec/free...
python
Apache-2.0
6cae1821fb77e785a8aebb48dfc72ea5081b8975
2026-01-04T14:38:15.504802Z
false
home-assistant/core
https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/patch_recorder.py
tests/patch_recorder.py
"""Patch recorder related functions.""" from __future__ import annotations from contextlib import contextmanager import sys # Patch recorder util session scope from homeassistant.helpers import recorder as recorder_helper # Make sure homeassistant.components.recorder.util is not already imported assert "homeassista...
python
Apache-2.0
6cae1821fb77e785a8aebb48dfc72ea5081b8975
2026-01-04T14:38:15.504802Z
false
home-assistant/core
https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/test_runner.py
tests/test_runner.py
"""Test the runner.""" import asyncio from collections.abc import Iterator import fcntl import json import os from pathlib import Path import subprocess import threading import time from unittest.mock import MagicMock, patch import packaging.tags import py import pytest from homeassistant import core, runner from ho...
python
Apache-2.0
6cae1821fb77e785a8aebb48dfc72ea5081b8975
2026-01-04T14:38:15.504802Z
false
home-assistant/core
https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/test_test_fixtures.py
tests/test_test_fixtures.py
"""Test test fixture configuration.""" from collections.abc import Callable, Generator from http import HTTPStatus import pathlib import socket from _pytest.compat import get_real_func from aiohttp import web import pytest import pytest_socket from homeassistant.core import HomeAssistant, async_get_hass from homeass...
python
Apache-2.0
6cae1821fb77e785a8aebb48dfc72ea5081b8975
2026-01-04T14:38:15.504802Z
false
home-assistant/core
https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/ignore_uncaught_exceptions.py
tests/ignore_uncaught_exceptions.py
"""List of tests that have uncaught exceptions today. Will be shrunk over time.""" IGNORE_UNCAUGHT_EXCEPTIONS = [ ( # This test explicitly throws an uncaught exception # and should not be removed. "tests.test_runner", "test_unhandled_exception_traceback", ), ( # This...
python
Apache-2.0
6cae1821fb77e785a8aebb48dfc72ea5081b8975
2026-01-04T14:38:15.504802Z
false
home-assistant/core
https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/test_setup.py
tests/test_setup.py
"""Test component/platform setup.""" import asyncio import threading from unittest.mock import ANY, AsyncMock, Mock, patch from freezegun.api import FrozenDateTimeFactory import pytest import voluptuous as vol from homeassistant import config_entries, loader, setup from homeassistant.config_entries import ConfigEntr...
python
Apache-2.0
6cae1821fb77e785a8aebb48dfc72ea5081b8975
2026-01-04T14:38:15.504802Z
true
home-assistant/core
https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/__init__.py
tests/__init__.py
"""Tests for Home Assistant."""
python
Apache-2.0
6cae1821fb77e785a8aebb48dfc72ea5081b8975
2026-01-04T14:38:15.504802Z
false
home-assistant/core
https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/syrupy.py
tests/syrupy.py
"""Home Assistant extension for Syrupy.""" from __future__ import annotations from contextlib import suppress import dataclasses from enum import IntFlag import json import os from pathlib import Path from typing import Any import attr import attrs import pytest from syrupy.constants import EXIT_STATUS_FAIL_UNUSED f...
python
Apache-2.0
6cae1821fb77e785a8aebb48dfc72ea5081b8975
2026-01-04T14:38:15.504802Z
false
home-assistant/core
https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/patch_json.py
tests/patch_json.py
"""Patch JSON related functions.""" from __future__ import annotations import functools from typing import Any from unittest import mock import orjson from homeassistant.helpers import json as json_helper real_json_encoder_default = json_helper.json_encoder_default mock_objects = [] def json_encoder_default(obj...
python
Apache-2.0
6cae1821fb77e785a8aebb48dfc72ea5081b8975
2026-01-04T14:38:15.504802Z
false
home-assistant/core
https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/test_exceptions.py
tests/test_exceptions.py
"""Test to verify that Home Assistant exceptions work.""" from __future__ import annotations from typing import Any from unittest.mock import patch import pytest from homeassistant.core import HomeAssistant from homeassistant.exceptions import ( ConditionErrorContainer, ConditionErrorIndex, ConditionErr...
python
Apache-2.0
6cae1821fb77e785a8aebb48dfc72ea5081b8975
2026-01-04T14:38:15.504802Z
false
home-assistant/core
https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/test_circular_imports.py
tests/test_circular_imports.py
"""Test to check for circular imports in core components.""" import asyncio import sys import pytest from homeassistant.bootstrap import ( CORE_INTEGRATIONS, DEFAULT_INTEGRATIONS, STAGE_0_INTEGRATIONS, STAGE_1_INTEGRATIONS, ) @pytest.mark.timeout(30) # cloud can take > 9s @pytest.mark.parametrize(...
python
Apache-2.0
6cae1821fb77e785a8aebb48dfc72ea5081b8975
2026-01-04T14:38:15.504802Z
false
home-assistant/core
https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/test_config_entries.py
tests/test_config_entries.py
"""Test the config manager.""" from __future__ import annotations import asyncio from collections.abc import Generator from contextlib import AbstractContextManager, nullcontext as does_not_raise from datetime import timedelta import logging import re from typing import Any, Self from unittest.mock import ANY, AsyncM...
python
Apache-2.0
6cae1821fb77e785a8aebb48dfc72ea5081b8975
2026-01-04T14:38:15.504802Z
true
home-assistant/core
https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/scripts/test_auth.py
tests/scripts/test_auth.py
"""Test the auth script to manage local users.""" import argparse import asyncio from collections.abc import Generator import logging from typing import Any from unittest.mock import Mock, patch import pytest from homeassistant.auth.providers import homeassistant as hass_auth from homeassistant.core import HomeAssis...
python
Apache-2.0
6cae1821fb77e785a8aebb48dfc72ea5081b8975
2026-01-04T14:38:15.504802Z
false
home-assistant/core
https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/scripts/test_check_config.py
tests/scripts/test_check_config.py
"""Test check_config script.""" import json import logging import os from unittest.mock import patch import pytest from homeassistant.config import YAML_CONFIG_FILE from homeassistant.scripts import check_config from tests.common import get_test_config_dir BASE_CONFIG = ( "homeassistant:\n" " name: Home\n...
python
Apache-2.0
6cae1821fb77e785a8aebb48dfc72ea5081b8975
2026-01-04T14:38:15.504802Z
false
home-assistant/core
https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/scripts/__init__.py
tests/scripts/__init__.py
"""Tests for the scripts."""
python
Apache-2.0
6cae1821fb77e785a8aebb48dfc72ea5081b8975
2026-01-04T14:38:15.504802Z
false
home-assistant/core
https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/scripts/test_init.py
tests/scripts/test_init.py
"""Test script init.""" from unittest.mock import patch from homeassistant import scripts @patch("homeassistant.scripts.get_default_config_dir", return_value="/default") def test_config_per_platform(mock_def) -> None: """Test config per platform method.""" assert scripts.get_default_config_dir() == "/defaul...
python
Apache-2.0
6cae1821fb77e785a8aebb48dfc72ea5081b8975
2026-01-04T14:38:15.504802Z
false
home-assistant/core
https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/test_util/test_aiohttp.py
tests/test_util/test_aiohttp.py
"""Tests for our aiohttp mocker.""" import pytest from .aiohttp import AiohttpClientMocker async def test_matching_url() -> None: """Test we can match urls.""" mocker = AiohttpClientMocker() mocker.get("http://example.com") await mocker.match_request("get", "http://example.com/") mocker.clear_r...
python
Apache-2.0
6cae1821fb77e785a8aebb48dfc72ea5081b8975
2026-01-04T14:38:15.504802Z
false
home-assistant/core
https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/test_util/aiohttp.py
tests/test_util/aiohttp.py
"""Aiohttp test utils.""" import asyncio from collections.abc import Iterator from contextlib import contextmanager from http import HTTPStatus import re from types import TracebackType from typing import Any from unittest import mock from urllib.parse import parse_qs from aiohttp import ClientSession from aiohttp.cl...
python
Apache-2.0
6cae1821fb77e785a8aebb48dfc72ea5081b8975
2026-01-04T14:38:15.504802Z
false
home-assistant/core
https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/test_util/__init__.py
tests/test_util/__init__.py
"""Test utilities.""" from collections.abc import Awaitable, Callable from aiohttp.web import Application, Request, StreamResponse, middleware def mock_real_ip(app: Application) -> Callable[[str], None]: """Inject middleware to mock real IP. Returns a function to set the real IP. """ ip_to_mock: st...
python
Apache-2.0
6cae1821fb77e785a8aebb48dfc72ea5081b8975
2026-01-04T14:38:15.504802Z
false
home-assistant/core
https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/util/test_color.py
tests/util/test_color.py
"""Test Home Assistant color util methods.""" import math import pytest from syrupy.assertion import SnapshotAssertion import voluptuous as vol from homeassistant.util import color as color_util GAMUT = color_util.GamutType( color_util.XYPoint(0.704, 0.296), color_util.XYPoint(0.2151, 0.7106), color_uti...
python
Apache-2.0
6cae1821fb77e785a8aebb48dfc72ea5081b8975
2026-01-04T14:38:15.504802Z
false
home-assistant/core
https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/util/test_uuid.py
tests/util/test_uuid.py
"""Test Home Assistant uuid util methods.""" import uuid from homeassistant.util import uuid as uuid_util async def test_uuid_util_random_uuid_hex() -> None: """Verify we can generate a random uuid.""" assert len(uuid_util.random_uuid_hex()) == 32 assert uuid.UUID(uuid_util.random_uuid_hex())
python
Apache-2.0
6cae1821fb77e785a8aebb48dfc72ea5081b8975
2026-01-04T14:38:15.504802Z
false
home-assistant/core
https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/util/test_logging.py
tests/util/test_logging.py
"""Test Home Assistant logging util methods.""" import asyncio from functools import partial import inspect import logging import queue from unittest.mock import patch from freezegun.api import FrozenDateTimeFactory import pytest from homeassistant.core import ( HomeAssistant, callback, is_callback, ...
python
Apache-2.0
6cae1821fb77e785a8aebb48dfc72ea5081b8975
2026-01-04T14:38:15.504802Z
false
home-assistant/core
https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/util/test_file.py
tests/util/test_file.py
"""Test Home Assistant file utility functions.""" import os from pathlib import Path from unittest.mock import patch import py import pytest from homeassistant.util.file import WriteError, write_utf8_file, write_utf8_file_atomic @pytest.mark.parametrize("func", [write_utf8_file, write_utf8_file_atomic]) def test_w...
python
Apache-2.0
6cae1821fb77e785a8aebb48dfc72ea5081b8975
2026-01-04T14:38:15.504802Z
false
home-assistant/core
https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/util/test_system_info.py
tests/util/test_system_info.py
"""Tests for the system info helper.""" from unittest.mock import patch from homeassistant.util.system_info import is_official_image async def test_is_official_image() -> None: """Test is_official_image.""" is_official_image.cache_clear() with patch("homeassistant.util.system_info.os.path.isfile", retur...
python
Apache-2.0
6cae1821fb77e785a8aebb48dfc72ea5081b8975
2026-01-04T14:38:15.504802Z
false
home-assistant/core
https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/util/test_read_only_dict.py
tests/util/test_read_only_dict.py
"""Test read only dictionary.""" import copy import json import pytest from homeassistant.util.read_only_dict import ReadOnlyDict def test_read_only_dict() -> None: """Test read only dictionary.""" data = ReadOnlyDict({"hello": "world"}) with pytest.raises(RuntimeError): data["hello"] = "unive...
python
Apache-2.0
6cae1821fb77e785a8aebb48dfc72ea5081b8975
2026-01-04T14:38:15.504802Z
false
home-assistant/core
https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/util/test_event_type.py
tests/util/test_event_type.py
"""Test EventType implementation.""" from __future__ import annotations import orjson from homeassistant.util.event_type import EventType def test_compatibility_with_str() -> None: """Test EventType. At runtime it should be (almost) fully compatible with str.""" event = EventType("Hello World") assert...
python
Apache-2.0
6cae1821fb77e785a8aebb48dfc72ea5081b8975
2026-01-04T14:38:15.504802Z
false
home-assistant/core
https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/util/test_resource.py
tests/util/test_resource.py
"""Test the resource utility module.""" import os import resource from unittest.mock import call, patch import pytest from homeassistant.util.resource import ( DEFAULT_SOFT_FILE_LIMIT, set_open_file_descriptor_limit, ) @pytest.mark.parametrize( ("original_soft", "expected_calls", "should_log_already_su...
python
Apache-2.0
6cae1821fb77e785a8aebb48dfc72ea5081b8975
2026-01-04T14:38:15.504802Z
false
home-assistant/core
https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/util/test_executor.py
tests/util/test_executor.py
"""Test Home Assistant executor util.""" import concurrent.futures import time from unittest.mock import patch import pytest from homeassistant.util import executor from homeassistant.util.executor import InterruptibleThreadPoolExecutor async def test_executor_shutdown_can_interrupt_threads( caplog: pytest.Log...
python
Apache-2.0
6cae1821fb77e785a8aebb48dfc72ea5081b8975
2026-01-04T14:38:15.504802Z
false
home-assistant/core
https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/util/test_unit_conversion.py
tests/util/test_unit_conversion.py
"""Test Home Assistant unit conversion utility functions.""" from __future__ import annotations import inspect from itertools import chain import pytest from homeassistant.const import ( CONCENTRATION_GRAMS_PER_CUBIC_METER, CONCENTRATION_MICROGRAMS_PER_CUBIC_METER, CONCENTRATION_MILLIGRAMS_PER_CUBIC_MET...
python
Apache-2.0
6cae1821fb77e785a8aebb48dfc72ea5081b8975
2026-01-04T14:38:15.504802Z
true
home-assistant/core
https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/util/test_dt.py
tests/util/test_dt.py
"""Test Home Assistant date util methods.""" from __future__ import annotations from datetime import UTC, datetime, timedelta import pytest from homeassistant.util import dt as dt_util DEFAULT_TIME_ZONE = dt_util.get_default_time_zone() TEST_TIME_ZONE = "America/Los_Angeles" @pytest.fixture(autouse=True) def tea...
python
Apache-2.0
6cae1821fb77e785a8aebb48dfc72ea5081b8975
2026-01-04T14:38:15.504802Z
false
home-assistant/core
https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/util/test_unit_system.py
tests/util/test_unit_system.py
"""Test the unit system helper.""" from __future__ import annotations import pytest from homeassistant.components.sensor import DEVICE_CLASS_UNITS, SensorDeviceClass from homeassistant.const import ( ACCUMULATED_PRECIPITATION, AREA, LENGTH, MASS, PRESSURE, TEMPERATURE, VOLUME, WIND_SP...
python
Apache-2.0
6cae1821fb77e785a8aebb48dfc72ea5081b8975
2026-01-04T14:38:15.504802Z
true
home-assistant/core
https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/util/test_json.py
tests/util/test_json.py
"""Test Home Assistant json utility functions.""" from pathlib import Path import re import orjson import pytest from homeassistant.exceptions import HomeAssistantError from homeassistant.util.json import ( json_loads, json_loads_array, json_loads_object, load_json, load_json_array, load_json...
python
Apache-2.0
6cae1821fb77e785a8aebb48dfc72ea5081b8975
2026-01-04T14:38:15.504802Z
false
home-assistant/core
https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/util/test_timeout.py
tests/util/test_timeout.py
"""Test Home Assistant timeout handler.""" import asyncio from contextlib import suppress import time import pytest from homeassistant.core import HomeAssistant from homeassistant.util.timeout import TimeoutManager async def test_simple_global_timeout() -> None: """Test a simple global timeout.""" timeout ...
python
Apache-2.0
6cae1821fb77e785a8aebb48dfc72ea5081b8975
2026-01-04T14:38:15.504802Z
false
home-assistant/core
https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/util/test_process.py
tests/util/test_process.py
"""Test process util.""" from functools import partial import os import subprocess import pytest from homeassistant.core import HomeAssistant from homeassistant.util import process async def test_kill_process(hass: HomeAssistant) -> None: """Test killing a process.""" sleeper = await hass.async_add_executo...
python
Apache-2.0
6cae1821fb77e785a8aebb48dfc72ea5081b8975
2026-01-04T14:38:15.504802Z
false
home-assistant/core
https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/util/test_async_iterator.py
tests/util/test_async_iterator.py
"""Tests for async iterator utility functions.""" from __future__ import annotations import asyncio from collections.abc import AsyncIterator import pytest from homeassistant.core import HomeAssistant from homeassistant.util.async_iterator import ( Abort, AsyncIteratorReader, AsyncIteratorWriter, ) de...
python
Apache-2.0
6cae1821fb77e785a8aebb48dfc72ea5081b8975
2026-01-04T14:38:15.504802Z
false
home-assistant/core
https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/util/test_location.py
tests/util/test_location.py
"""Test Home Assistant location util methods.""" from unittest.mock import Mock, patch import aiohttp import pytest from homeassistant.core import HomeAssistant from homeassistant.helpers.aiohttp_client import async_get_clientsession from homeassistant.util import location as location_util from tests.common import ...
python
Apache-2.0
6cae1821fb77e785a8aebb48dfc72ea5081b8975
2026-01-04T14:38:15.504802Z
false
home-assistant/core
https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/util/test_aiohttp.py
tests/util/test_aiohttp.py
"""Test aiohttp request helper.""" from aiohttp import web from homeassistant.util import aiohttp async def test_request_json() -> None: """Test a JSON request.""" request = aiohttp.MockRequest(b'{"hello": 2}', mock_source="test") assert request.status == 200 assert await request.json() == {"hello":...
python
Apache-2.0
6cae1821fb77e785a8aebb48dfc72ea5081b8975
2026-01-04T14:38:15.504802Z
false
home-assistant/core
https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/util/test_ssl.py
tests/util/test_ssl.py
"""Test Home Assistant ssl utility functions.""" from unittest.mock import MagicMock, Mock, patch import pytest from homeassistant.util.ssl import ( SSLCipherList, client_context, create_client_context, create_no_verify_ssl_context, ) @pytest.fixture def mock_sslcontext(): """Mock the ssl lib."...
python
Apache-2.0
6cae1821fb77e785a8aebb48dfc72ea5081b8975
2026-01-04T14:38:15.504802Z
false
home-assistant/core
https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/util/test_percentage.py
tests/util/test_percentage.py
"""Test Home Assistant percentage conversions.""" import math import pytest from homeassistant.util.percentage import ( ordered_list_item_to_percentage, percentage_to_ordered_list_item, percentage_to_ranged_value, ranged_value_to_percentage, ) SPEED_LOW = "low" SPEED_MEDIUM = "medium" SPEED_HIGH = "...
python
Apache-2.0
6cae1821fb77e785a8aebb48dfc72ea5081b8975
2026-01-04T14:38:15.504802Z
false
home-assistant/core
https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/util/test_collection.py
tests/util/test_collection.py
"""Test collection utils.""" from homeassistant.util.collection import chunked_or_all def test_chunked_or_all() -> None: """Test chunked_or_all can iterate chunk sizes larger than the passed in collection.""" all_items = [] incoming = (1, 2, 3, 4) for chunk in chunked_or_all(incoming, 2): ass...
python
Apache-2.0
6cae1821fb77e785a8aebb48dfc72ea5081b8975
2026-01-04T14:38:15.504802Z
false
home-assistant/core
https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/util/test_scaling.py
tests/util/test_scaling.py
"""Test Home Assistant scaling utils.""" import math import pytest from homeassistant.util.percentage import ( scale_ranged_value_to_int_range, scale_to_ranged_value, ) @pytest.mark.parametrize( ("input_val", "output_val"), [ (255, 100), (127, 49), (10, 3), (1, 0), ...
python
Apache-2.0
6cae1821fb77e785a8aebb48dfc72ea5081b8975
2026-01-04T14:38:15.504802Z
false
home-assistant/core
https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/util/test_thread.py
tests/util/test_thread.py
"""Test Home Assistant thread utils.""" import asyncio from unittest.mock import Mock, patch import pytest from homeassistant.core import HomeAssistant from homeassistant.util import thread from homeassistant.util.async_ import run_callback_threadsafe from homeassistant.util.thread import ThreadWithException async...
python
Apache-2.0
6cae1821fb77e785a8aebb48dfc72ea5081b8975
2026-01-04T14:38:15.504802Z
false
home-assistant/core
https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/util/test_ulid.py
tests/util/test_ulid.py
"""Test Home Assistant ulid util methods.""" import uuid from homeassistant.util import ulid as ulid_util async def test_ulid_util_uuid_hex() -> None: """Verify we can generate a ulid in hex.""" assert len(ulid_util.ulid_hex()) == 32 assert uuid.UUID(ulid_util.ulid_hex()) async def test_ulid_util_uuid...
python
Apache-2.0
6cae1821fb77e785a8aebb48dfc72ea5081b8975
2026-01-04T14:38:15.504802Z
false
home-assistant/core
https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/util/test_variance.py
tests/util/test_variance.py
"""Test variance method.""" from datetime import datetime, timedelta import pytest from homeassistant.util.variance import ignore_variance @pytest.mark.parametrize( ("value_1", "value_2", "variance", "expected"), [ (1, 1, 1, 1), (1, 2, 2, 1), (1, 2, 0, 2), (2, 1, 0, 1), ...
python
Apache-2.0
6cae1821fb77e785a8aebb48dfc72ea5081b8975
2026-01-04T14:38:15.504802Z
false
home-assistant/core
https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/util/test_loop.py
tests/util/test_loop.py
"""Tests for async util methods from Python source.""" from collections.abc import Generator import contextlib import threading from unittest.mock import Mock, patch import pytest from homeassistant.core import HomeAssistant from homeassistant.util import loop as haloop from tests.common import extract_stack_to_fra...
python
Apache-2.0
6cae1821fb77e785a8aebb48dfc72ea5081b8975
2026-01-04T14:38:15.504802Z
false
home-assistant/core
https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/util/__init__.py
tests/util/__init__.py
"""The tests for the utilities."""
python
Apache-2.0
6cae1821fb77e785a8aebb48dfc72ea5081b8975
2026-01-04T14:38:15.504802Z
false
home-assistant/core
https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/util/test_network.py
tests/util/test_network.py
"""Test Home Assistant volume utility functions.""" from ipaddress import ip_address from homeassistant.util import network as network_util def test_is_loopback() -> None: """Test loopback addresses.""" assert network_util.is_loopback(ip_address("127.0.0.2")) assert network_util.is_loopback(ip_address("...
python
Apache-2.0
6cae1821fb77e785a8aebb48dfc72ea5081b8975
2026-01-04T14:38:15.504802Z
false
home-assistant/core
https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/util/test_hass_dict.py
tests/util/test_hass_dict.py
"""Test HassDict and custom HassKey types.""" from homeassistant.util.hass_dict import HassDict, HassEntryKey, HassKey def test_key_comparison() -> None: """Test key comparison with itself and string keys.""" str_key = "custom-key" key = HassKey[int](str_key) other_key = HassKey[str]("other-key") ...
python
Apache-2.0
6cae1821fb77e785a8aebb48dfc72ea5081b8975
2026-01-04T14:38:15.504802Z
false
home-assistant/core
https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/util/test_enum.py
tests/util/test_enum.py
"""Test enum helpers.""" from enum import Enum, IntEnum, IntFlag, StrEnum from typing import Any import pytest from homeassistant.util.enum import try_parse_enum class _AStrEnum(StrEnum): VALUE = "value" class _AnIntEnum(IntEnum): VALUE = 1 class _AnIntFlag(IntFlag): VALUE = 1 SECOND = 2 @pyt...
python
Apache-2.0
6cae1821fb77e785a8aebb48dfc72ea5081b8975
2026-01-04T14:38:15.504802Z
false
home-assistant/core
https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/util/test_language.py
tests/util/test_language.py
"""Test Home Assistant language util methods.""" from __future__ import annotations import pytest from homeassistant.const import MATCH_ALL from homeassistant.util import language def test_match_all() -> None: """Test MATCH_ALL.""" assert language.matches(MATCH_ALL, ["fr-Fr", "en-US", "en-GB"]) == [ ...
python
Apache-2.0
6cae1821fb77e785a8aebb48dfc72ea5081b8975
2026-01-04T14:38:15.504802Z
false
home-assistant/core
https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/util/test_async.py
tests/util/test_async.py
"""Tests for async util methods from Python source.""" import asyncio import time from unittest.mock import MagicMock, Mock, patch import pytest from homeassistant.core import HomeAssistant from homeassistant.util import async_ as hasync from tests.common import extract_stack_to_frame @patch("concurrent.futures.F...
python
Apache-2.0
6cae1821fb77e785a8aebb48dfc72ea5081b8975
2026-01-04T14:38:15.504802Z
false
home-assistant/core
https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/util/test_init.py
tests/util/test_init.py
"""Test Home Assistant util methods.""" from datetime import datetime, timedelta from unittest.mock import MagicMock, patch import pytest from homeassistant import util from homeassistant.util import dt as dt_util def test_raise_if_invalid_filename() -> None: """Test raise_if_invalid_filename.""" assert ut...
python
Apache-2.0
6cae1821fb77e785a8aebb48dfc72ea5081b8975
2026-01-04T14:38:15.504802Z
false
home-assistant/core
https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/util/test_package.py
tests/util/test_package.py
"""Test Home Assistant package util methods.""" import asyncio from collections.abc import Generator from importlib.metadata import metadata import logging import os from subprocess import PIPE import sys from unittest.mock import MagicMock, Mock, call, patch import pytest from homeassistant.util import package RES...
python
Apache-2.0
6cae1821fb77e785a8aebb48dfc72ea5081b8975
2026-01-04T14:38:15.504802Z
false
home-assistant/core
https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/util/yaml/test_secrets.py
tests/util/yaml/test_secrets.py
"""Test Home Assistant secret substitution in YAML files.""" from dataclasses import dataclass import logging from pathlib import Path import pytest from homeassistant.config import YAML_CONFIG_FILE, load_yaml_config_file from homeassistant.exceptions import HomeAssistantError from homeassistant.util import yaml as ...
python
Apache-2.0
6cae1821fb77e785a8aebb48dfc72ea5081b8975
2026-01-04T14:38:15.504802Z
false
home-assistant/core
https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/util/yaml/test_input.py
tests/util/yaml/test_input.py
"""Test inputs.""" import pytest from homeassistant.util.yaml import ( Input, UndefinedSubstitution, extract_inputs, substitute, ) def test_extract_inputs() -> None: """Test extracting inputs from data.""" assert extract_inputs(Input("hello")) == {"hello"} assert extract_inputs({"info": ...
python
Apache-2.0
6cae1821fb77e785a8aebb48dfc72ea5081b8975
2026-01-04T14:38:15.504802Z
false
home-assistant/core
https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/util/yaml/__init__.py
tests/util/yaml/__init__.py
"""Tests for YAML util."""
python
Apache-2.0
6cae1821fb77e785a8aebb48dfc72ea5081b8975
2026-01-04T14:38:15.504802Z
false
home-assistant/core
https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/util/yaml/test_init.py
tests/util/yaml/test_init.py
"""Test Home Assistant yaml loader.""" from collections.abc import Generator import importlib import io import os import pathlib from typing import Any from unittest.mock import Mock, patch import pytest import voluptuous as vol import yaml as pyyaml from homeassistant.config import YAML_CONFIG_FILE, load_yaml_confi...
python
Apache-2.0
6cae1821fb77e785a8aebb48dfc72ea5081b8975
2026-01-04T14:38:15.504802Z
false
home-assistant/core
https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/auth/test_jwt_wrapper.py
tests/auth/test_jwt_wrapper.py
"""Tests for the Home Assistant auth jwt_wrapper module.""" import jwt import pytest from homeassistant.auth import jwt_wrapper async def test_all_default_options_are_in_verify_options() -> None: """Test that all default options in _VERIFY_OPTIONS.""" for option in jwt_wrapper._PyJWTWithVerify._get_default_...
python
Apache-2.0
6cae1821fb77e785a8aebb48dfc72ea5081b8975
2026-01-04T14:38:15.504802Z
false
home-assistant/core
https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/auth/test_auth_store.py
tests/auth/test_auth_store.py
"""Tests for the auth store.""" import asyncio from typing import Any from unittest.mock import PropertyMock, patch from freezegun.api import FrozenDateTimeFactory import pytest from homeassistant.auth import auth_store from homeassistant.core import HomeAssistant MOCK_STORAGE_DATA = { "version": 1, "data":...
python
Apache-2.0
6cae1821fb77e785a8aebb48dfc72ea5081b8975
2026-01-04T14:38:15.504802Z
false
home-assistant/core
https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/auth/test_models.py
tests/auth/test_models.py
"""Tests for the auth models.""" from homeassistant.auth import models, permissions def test_owner_fetching_owner_permissions() -> None: """Test we fetch the owner permissions for an owner user.""" group = models.Group(name="Test Group", policy={}) owner = models.User( name="Test User", perm_look...
python
Apache-2.0
6cae1821fb77e785a8aebb48dfc72ea5081b8975
2026-01-04T14:38:15.504802Z
false
home-assistant/core
https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/auth/__init__.py
tests/auth/__init__.py
"""Tests for the Home Assistant auth module."""
python
Apache-2.0
6cae1821fb77e785a8aebb48dfc72ea5081b8975
2026-01-04T14:38:15.504802Z
false
home-assistant/core
https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/auth/test_init.py
tests/auth/test_init.py
"""Tests for the Home Assistant auth module.""" from datetime import timedelta import time from typing import Any from unittest.mock import patch from freezegun import freeze_time import jwt import pytest import voluptuous as vol from homeassistant import auth, data_entry_flow from homeassistant.auth import ( EV...
python
Apache-2.0
6cae1821fb77e785a8aebb48dfc72ea5081b8975
2026-01-04T14:38:15.504802Z
true
home-assistant/core
https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/auth/permissions/test_entities.py
tests/auth/permissions/test_entities.py
"""Tests for entity permissions.""" import pytest import voluptuous as vol from homeassistant.auth.permissions.entities import ( ENTITY_POLICY_SCHEMA, compile_entities, ) from homeassistant.auth.permissions.models import PermissionLookup from homeassistant.core import HomeAssistant from homeassistant.helpers....
python
Apache-2.0
6cae1821fb77e785a8aebb48dfc72ea5081b8975
2026-01-04T14:38:15.504802Z
false
home-assistant/core
https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/auth/permissions/test_util.py
tests/auth/permissions/test_util.py
"""Test the permission utils.""" from homeassistant.auth.permissions import util def test_test_all() -> None: """Test if we can test the all group.""" for val in (None, {}, {"all": None}, {"all": {}}): assert util.test_all(val, "read") is False for val in (True, {"all": True}, {"all": {"read": T...
python
Apache-2.0
6cae1821fb77e785a8aebb48dfc72ea5081b8975
2026-01-04T14:38:15.504802Z
false
home-assistant/core
https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/auth/permissions/__init__.py
tests/auth/permissions/__init__.py
"""Tests for permissions."""
python
Apache-2.0
6cae1821fb77e785a8aebb48dfc72ea5081b8975
2026-01-04T14:38:15.504802Z
false
home-assistant/core
https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/auth/permissions/test_merge.py
tests/auth/permissions/test_merge.py
"""Tests for permissions merging.""" from homeassistant.auth.permissions.merge import merge_policies def test_merging_permissions_true_rules_dict() -> None: """Test merging policy with two entities.""" policy1 = { "something_else": True, "entities": {"entity_ids": {"light.kitchen": True}}, ...
python
Apache-2.0
6cae1821fb77e785a8aebb48dfc72ea5081b8975
2026-01-04T14:38:15.504802Z
false
home-assistant/core
https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/auth/permissions/test_system_policies.py
tests/auth/permissions/test_system_policies.py
"""Test system policies.""" from homeassistant.auth.permissions import ( POLICY_SCHEMA, PolicyPermissions, system_policies, ) def test_admin_policy() -> None: """Test admin policy works.""" # Make sure it's valid POLICY_SCHEMA(system_policies.ADMIN_POLICY) perms = PolicyPermissions(syste...
python
Apache-2.0
6cae1821fb77e785a8aebb48dfc72ea5081b8975
2026-01-04T14:38:15.504802Z
false
home-assistant/core
https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/auth/providers/test_command_line.py
tests/auth/providers/test_command_line.py
"""Tests for the command_line auth provider.""" import os from unittest.mock import AsyncMock import uuid import pytest from homeassistant import data_entry_flow from homeassistant.auth import AuthManager, auth_store, models as auth_models from homeassistant.auth.providers import command_line from homeassistant.cons...
python
Apache-2.0
6cae1821fb77e785a8aebb48dfc72ea5081b8975
2026-01-04T14:38:15.504802Z
false
home-assistant/core
https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/auth/providers/test_trusted_networks.py
tests/auth/providers/test_trusted_networks.py
"""Test the Trusted Networks auth provider.""" from ipaddress import ip_address, ip_network from unittest.mock import Mock, patch from hass_nabucasa import remote import pytest import voluptuous as vol from homeassistant import auth from homeassistant.auth import auth_store from homeassistant.auth.providers import t...
python
Apache-2.0
6cae1821fb77e785a8aebb48dfc72ea5081b8975
2026-01-04T14:38:15.504802Z
false
home-assistant/core
https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/auth/providers/test_insecure_example.py
tests/auth/providers/test_insecure_example.py
"""Tests for the insecure example auth provider.""" from unittest.mock import AsyncMock import uuid import pytest from homeassistant.auth import AuthManager, auth_store, models as auth_models from homeassistant.auth.providers import insecure_example from homeassistant.core import HomeAssistant @pytest.fixture asyn...
python
Apache-2.0
6cae1821fb77e785a8aebb48dfc72ea5081b8975
2026-01-04T14:38:15.504802Z
false
home-assistant/core
https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/auth/providers/test_homeassistant.py
tests/auth/providers/test_homeassistant.py
"""Test the Home Assistant local auth provider.""" import asyncio from typing import Any from unittest.mock import Mock, patch import pytest import voluptuous as vol from homeassistant import data_entry_flow from homeassistant.auth import auth_manager_from_config, auth_store from homeassistant.auth.providers import ...
python
Apache-2.0
6cae1821fb77e785a8aebb48dfc72ea5081b8975
2026-01-04T14:38:15.504802Z
false
home-assistant/core
https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/auth/providers/__init__.py
tests/auth/providers/__init__.py
"""Tests for the auth providers."""
python
Apache-2.0
6cae1821fb77e785a8aebb48dfc72ea5081b8975
2026-01-04T14:38:15.504802Z
false
home-assistant/core
https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/auth/mfa_modules/test_notify.py
tests/auth/mfa_modules/test_notify.py
"""Test the HMAC-based One Time Password (MFA) auth module.""" import asyncio from unittest.mock import patch import voluptuous_serialize from homeassistant import data_entry_flow from homeassistant.auth import auth_manager_from_config, models as auth_models from homeassistant.auth.mfa_modules import auth_mfa_module...
python
Apache-2.0
6cae1821fb77e785a8aebb48dfc72ea5081b8975
2026-01-04T14:38:15.504802Z
false
home-assistant/core
https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/auth/mfa_modules/test_insecure_example.py
tests/auth/mfa_modules/test_insecure_example.py
"""Test the example module auth module.""" from homeassistant import auth, data_entry_flow from homeassistant.auth.mfa_modules import auth_mfa_module_from_config from homeassistant.auth.models import Credentials from homeassistant.core import HomeAssistant from tests.common import MockUser async def test_validate(h...
python
Apache-2.0
6cae1821fb77e785a8aebb48dfc72ea5081b8975
2026-01-04T14:38:15.504802Z
false
home-assistant/core
https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/auth/mfa_modules/__init__.py
tests/auth/mfa_modules/__init__.py
"""Tests for the multi-factor auth modules."""
python
Apache-2.0
6cae1821fb77e785a8aebb48dfc72ea5081b8975
2026-01-04T14:38:15.504802Z
false
home-assistant/core
https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/auth/mfa_modules/test_totp.py
tests/auth/mfa_modules/test_totp.py
"""Test the Time-based One Time Password (MFA) auth module.""" import asyncio from unittest.mock import patch from homeassistant import data_entry_flow from homeassistant.auth import auth_manager_from_config, models as auth_models from homeassistant.auth.mfa_modules import auth_mfa_module_from_config from homeassista...
python
Apache-2.0
6cae1821fb77e785a8aebb48dfc72ea5081b8975
2026-01-04T14:38:15.504802Z
false
home-assistant/core
https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/hassfest/test_requirements.py
tests/hassfest/test_requirements.py
"""Tests for hassfest requirements.""" from collections.abc import Generator from importlib.metadata import PackagePath from pathlib import Path from unittest.mock import patch import pytest from script.hassfest.model import Config, Integration from script.hassfest.requirements import ( FORBIDDEN_PACKAGE_NAMES, ...
python
Apache-2.0
6cae1821fb77e785a8aebb48dfc72ea5081b8975
2026-01-04T14:38:15.504802Z
false
home-assistant/core
https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/hassfest/test_dependencies.py
tests/hassfest/test_dependencies.py
"""Tests for hassfest dependency finder.""" import ast import pytest from script.hassfest.dependencies import ImportCollector @pytest.fixture def mock_collector(): """Fixture with import collector that adds all referenced nodes.""" collector = ImportCollector(None) collector.unfiltered_referenced = set...
python
Apache-2.0
6cae1821fb77e785a8aebb48dfc72ea5081b8975
2026-01-04T14:38:15.504802Z
false