--- Begin Message ---
Package: src:python-homeassistant-analytics
Version: 0.7.0-2
Severity: serious
Tags: ftbfs
Dear maintainer:
During a rebuild of all packages in unstable, your package failed to build:
--------------------------------------------------------------------------------
[...]
debian/rules binary
dh binary --buildsystem=pybuild
dh_update_autotools_config -O--buildsystem=pybuild
dh_autoreconf -O--buildsystem=pybuild
dh_auto_configure -O--buildsystem=pybuild
dh_auto_build -O--buildsystem=pybuild
I: pybuild plugin_pyproject:129: Building wheel for python3.12 with "build"
module
I: pybuild base:311: python3.12 -m build --skip-dependency-check --no-isolation --wheel
--outdir /<<PKGBUILDDIR>>/.pybuild/cpython3_3.12_python-homeassistant-analytics
* Building wheel...
Successfully built python_homeassistant_analytics-0.5.0-py3-none-any.whl
I: pybuild plugin_pyproject:144: Unpacking wheel built for python3.12 with
"installer" module
dh_auto_test -O--buildsystem=pybuild
I: pybuild base:311: cd
/<<PKGBUILDDIR>>/.pybuild/cpython3_3.12_python-homeassistant-analytics/build;
python3.12 -m pytest --no-cov
/usr/lib/python3/dist-packages/pytest_asyncio/plugin.py:208: PytestDeprecationWarning:
The configuration option "asyncio_default_fixture_loop_scope" is unset.
The event loop scope for asynchronous fixtures will default to the fixture caching scope. Future versions of pytest-asyncio will
default the loop scope for asynchronous fixtures to function scope. Set the default fixture loop scope explicitly in order to
avoid unexpected behavior in the future. Valid fixture loop scopes are: "function", "class",
"module", "package", "session"
warnings.warn(PytestDeprecationWarning(_DEFAULT_FIXTURE_LOOP_SCOPE_UNSET))
============================= test session starts ==============================
platform linux -- Python 3.12.7, pytest-8.3.3, pluggy-1.5.0
rootdir:
/<<PKGBUILDDIR>>/.pybuild/cpython3_3.12_python-homeassistant-analytics/build
configfile: pyproject.toml
plugins: syrupy-4.7.1, typeguard-4.3.0, asyncio-0.24.0a1, cov-5.0.0
asyncio: mode=Mode.AUTO, default_loop_scope=None
collected 9 items
tests/test_python_homeassistant_analytics.py FFFFFFFFF [100%]
=================================== FAILURES ===================================
_________________________ test_putting_in_own_session __________________________
responses = <aioresponses.core.aioresponses object at 0x7f9bc95a6780>
async def test_putting_in_own_session(
responses: aioresponses,
) -> None:
"""Test putting in own session."""
responses.get(
f"{HOMEASSISTANT_ANALYTICS_URL}/data.json",
status=200,
body=load_fixture("data.json"),
)
async with aiohttp.ClientSession() as session:
analytics = HomeassistantAnalyticsClient(session=session)
await analytics.get_analytics()
tests/test_python_homeassistant_analytics.py:33:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
python_homeassistant_analytics/python_homeassistant_analytics.py:87: in
get_analytics
response = await self._request("analytics.home-assistant.io", "data.json")
python_homeassistant_analytics/python_homeassistant_analytics.py:59: in _request
response = await self.session.get(
/usr/lib/python3.12/unittest/mock.py:2293: in _execute_mock_call
result = await effect(*args, **kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <aioresponses.core.aioresponses object at 0x7f9bc95a6780>
orig_self = <aiohttp.client.ClientSession object at 0x7f9bc9539730>
method = 'GET', url = URL('https://analytics.home-assistant.io/data.json')
args = ()
kwargs = {'allow_redirects': True, 'headers': {'Accept': 'application/json,
text/plain, */*', 'User-Agent': 'PythonHomeassistantAnalytics/0.5.0'}}
url_origin = URL('https://analytics.home-assistant.io/data.json')
url_str = 'https://analytics.home-assistant.io/data.json'
key = ('GET', URL('https://analytics.home-assistant.io/data.json'))
request_call = RequestCall(args=(), kwargs={'headers': {'User-Agent':
'PythonHomeassistantAnalytics/0.5.0', 'Accept': 'application/json, text/plain,
*/*'}, 'allow_redirects': True})
response = None
async def _request_mock(self, orig_self: ClientSession,
method: str, url: 'Union[URL, str]',
*args: Tuple,
**kwargs: Any) -> 'ClientResponse':
"""Return mocked response object or raise connection error."""
if orig_self.closed:
raise RuntimeError('Session is closed')
url_origin = url
url = normalize_url(merge_params(url, kwargs.get('params')))
url_str = str(url)
for prefix in self._passthrough:
if url_str.startswith(prefix):
return (await self.patcher.temp_original(
orig_self, method, url_origin, *args, **kwargs
))
key = (method, url)
self.requests.setdefault(key, [])
request_call = self._build_request_call(method, *args, **kwargs)
self.requests[key].append(request_call)
response = await self.match(method, url, **kwargs)
if response is None:
raise ClientConnectionError(
'Connection refused: {} {}'.format(method, url)
)
E aiohttp.client_exceptions.ClientConnectionError: Connection
refused: GET https://analytics.home-assistant.io/data.json
/usr/lib/python3/dist-packages/aioresponses/core.py:515: ClientConnectionError
__________________________ test_creating_own_session ___________________________
responses = <aioresponses.core.aioresponses object at 0x7f9bc95ceff0>
async def test_creating_own_session(
responses: aioresponses,
) -> None:
"""Test creating own session."""
responses.get(
f"{HOMEASSISTANT_ANALYTICS_URL}/data.json",
status=200,
body=load_fixture("data.json"),
)
analytics = HomeassistantAnalyticsClient()
await analytics.get_analytics()
tests/test_python_homeassistant_analytics.py:50:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
python_homeassistant_analytics/python_homeassistant_analytics.py:87: in
get_analytics
response = await self._request("analytics.home-assistant.io", "data.json")
python_homeassistant_analytics/python_homeassistant_analytics.py:59: in _request
response = await self.session.get(
/usr/lib/python3.12/unittest/mock.py:2293: in _execute_mock_call
result = await effect(*args, **kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <aioresponses.core.aioresponses object at 0x7f9bc95ceff0>
orig_self = <aiohttp.client.ClientSession object at 0x7f9bc95cfe00>
method = 'GET', url = URL('https://analytics.home-assistant.io/data.json')
args = ()
kwargs = {'allow_redirects': True, 'headers': {'Accept': 'application/json,
text/plain, */*', 'User-Agent': 'PythonHomeassistantAnalytics/0.5.0'}}
url_origin = URL('https://analytics.home-assistant.io/data.json')
url_str = 'https://analytics.home-assistant.io/data.json'
key = ('GET', URL('https://analytics.home-assistant.io/data.json'))
request_call = RequestCall(args=(), kwargs={'headers': {'User-Agent':
'PythonHomeassistantAnalytics/0.5.0', 'Accept': 'application/json, text/plain,
*/*'}, 'allow_redirects': True})
response = None
async def _request_mock(self, orig_self: ClientSession,
method: str, url: 'Union[URL, str]',
*args: Tuple,
**kwargs: Any) -> 'ClientResponse':
"""Return mocked response object or raise connection error."""
if orig_self.closed:
raise RuntimeError('Session is closed')
url_origin = url
url = normalize_url(merge_params(url, kwargs.get('params')))
url_str = str(url)
for prefix in self._passthrough:
if url_str.startswith(prefix):
return (await self.patcher.temp_original(
orig_self, method, url_origin, *args, **kwargs
))
key = (method, url)
self.requests.setdefault(key, [])
request_call = self._build_request_call(method, *args, **kwargs)
self.requests[key].append(request_call)
response = await self.match(method, url, **kwargs)
if response is None:
raise ClientConnectionError(
'Connection refused: {} {}'.format(method, url)
)
E aiohttp.client_exceptions.ClientConnectionError: Connection
refused: GET https://analytics.home-assistant.io/data.json
/usr/lib/python3/dist-packages/aioresponses/core.py:515: ClientConnectionError
_______________________ test_unexpected_server_response ________________________
responses = <aioresponses.core.aioresponses object at 0x7f9bc944d040>
homeassistant_analytics_client =
HomeassistantAnalyticsClient(session=<aiohttp.client.ClientSession object at
0x7f9bc944e1e0>, request_timeout=10, api_host='analytics.home-assistant.io',
_close_session=False, _etags={})
async def test_unexpected_server_response(
responses: aioresponses,
homeassistant_analytics_client: HomeassistantAnalyticsClient,
) -> None:
"""Test handling unexpected response."""
responses.get(
f"{HOMEASSISTANT_ANALYTICS_URL}/data.json",
status=200,
headers={"Content-Type": "plain/text"},
body="Yes",
)
with pytest.raises(HomeassistantAnalyticsError):
assert await homeassistant_analytics_client.get_analytics()
tests/test_python_homeassistant_analytics.py:69:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
python_homeassistant_analytics/python_homeassistant_analytics.py:87: in
get_analytics
response = await self._request("analytics.home-assistant.io", "data.json")
python_homeassistant_analytics/python_homeassistant_analytics.py:59: in _request
response = await self.session.get(
/usr/lib/python3.12/unittest/mock.py:2293: in _execute_mock_call
result = await effect(*args, **kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <aioresponses.core.aioresponses object at 0x7f9bc944d040>
orig_self = <aiohttp.client.ClientSession object at 0x7f9bc944e1e0>
method = 'GET', url = URL('https://analytics.home-assistant.io/data.json')
args = ()
kwargs = {'allow_redirects': True, 'headers': {'Accept': 'application/json,
text/plain, */*', 'User-Agent': 'PythonHomeassistantAnalytics/0.5.0'}}
url_origin = URL('https://analytics.home-assistant.io/data.json')
url_str = 'https://analytics.home-assistant.io/data.json'
key = ('GET', URL('https://analytics.home-assistant.io/data.json'))
request_call = RequestCall(args=(), kwargs={'headers': {'User-Agent':
'PythonHomeassistantAnalytics/0.5.0', 'Accept': 'application/json, text/plain,
*/*'}, 'allow_redirects': True})
response = None
async def _request_mock(self, orig_self: ClientSession,
method: str, url: 'Union[URL, str]',
*args: Tuple,
**kwargs: Any) -> 'ClientResponse':
"""Return mocked response object or raise connection error."""
if orig_self.closed:
raise RuntimeError('Session is closed')
url_origin = url
url = normalize_url(merge_params(url, kwargs.get('params')))
url_str = str(url)
for prefix in self._passthrough:
if url_str.startswith(prefix):
return (await self.patcher.temp_original(
orig_self, method, url_origin, *args, **kwargs
))
key = (method, url)
self.requests.setdefault(key, [])
request_call = self._build_request_call(method, *args, **kwargs)
self.requests[key].append(request_call)
response = await self.match(method, url, **kwargs)
if response is None:
raise ClientConnectionError(
'Connection refused: {} {}'.format(method, url)
)
E aiohttp.client_exceptions.ClientConnectionError: Connection
refused: GET https://analytics.home-assistant.io/data.json
/usr/lib/python3/dist-packages/aioresponses/core.py:515: ClientConnectionError
_________________________________ test_timeout _________________________________
responses = <aioresponses.core.aioresponses object at 0x7f9bc953af60>
async def test_timeout(
responses: aioresponses,
) -> None:
"""Test request timeout."""
# Faking a timeout by sleeping
async def response_handler(_: str, **_kwargs: Any) -> CallbackResult:
"""Response handler for this test."""
await asyncio.sleep(2)
return CallbackResult(body="Goodmorning!")
responses.get(
f"{HOMEASSISTANT_ANALYTICS_URL}/data.json",
callback=response_handler,
)
async with HomeassistantAnalyticsClient(
request_timeout=1,
) as homeassistant_analytics_client:
with pytest.raises(HomeassistantAnalyticsConnectionError):
assert await homeassistant_analytics_client.get_analytics()
tests/test_python_homeassistant_analytics.py:91:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
python_homeassistant_analytics/python_homeassistant_analytics.py:87: in
get_analytics
response = await self._request("analytics.home-assistant.io", "data.json")
python_homeassistant_analytics/python_homeassistant_analytics.py:59: in _request
response = await self.session.get(
/usr/lib/python3.12/unittest/mock.py:2293: in _execute_mock_call
result = await effect(*args, **kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <aioresponses.core.aioresponses object at 0x7f9bc953af60>
orig_self = <aiohttp.client.ClientSession object at 0x7f9bc95ced80>
method = 'GET', url = URL('https://analytics.home-assistant.io/data.json')
args = ()
kwargs = {'allow_redirects': True, 'headers': {'Accept': 'application/json,
text/plain, */*', 'User-Agent': 'PythonHomeassistantAnalytics/0.5.0'}}
url_origin = URL('https://analytics.home-assistant.io/data.json')
url_str = 'https://analytics.home-assistant.io/data.json'
key = ('GET', URL('https://analytics.home-assistant.io/data.json'))
request_call = RequestCall(args=(), kwargs={'headers': {'User-Agent':
'PythonHomeassistantAnalytics/0.5.0', 'Accept': 'application/json, text/plain,
*/*'}, 'allow_redirects': True})
response = None
async def _request_mock(self, orig_self: ClientSession,
method: str, url: 'Union[URL, str]',
*args: Tuple,
**kwargs: Any) -> 'ClientResponse':
"""Return mocked response object or raise connection error."""
if orig_self.closed:
raise RuntimeError('Session is closed')
url_origin = url
url = normalize_url(merge_params(url, kwargs.get('params')))
url_str = str(url)
for prefix in self._passthrough:
if url_str.startswith(prefix):
return (await self.patcher.temp_original(
orig_self, method, url_origin, *args, **kwargs
))
key = (method, url)
self.requests.setdefault(key, [])
request_call = self._build_request_call(method, *args, **kwargs)
self.requests[key].append(request_call)
response = await self.match(method, url, **kwargs)
if response is None:
raise ClientConnectionError(
'Connection refused: {} {}'.format(method, url)
)
E aiohttp.client_exceptions.ClientConnectionError: Connection
refused: GET https://analytics.home-assistant.io/data.json
/usr/lib/python3/dist-packages/aioresponses/core.py:515: ClientConnectionError
________________________________ test_analytics ________________________________
responses = <aioresponses.core.aioresponses object at 0x7f9bc95cd6a0>
homeassistant_analytics_client =
HomeassistantAnalyticsClient(session=<aiohttp.client.ClientSession object at
0x7f9bc944fa10>, request_timeout=10, api_host='analytics.home-assistant.io',
_close_session=False, _etags={})
snapshot = SnapshotAssertion(name='snapshot', num_executions=0)
async def test_analytics(
responses: aioresponses,
homeassistant_analytics_client: HomeassistantAnalyticsClient,
snapshot: SnapshotAssertion,
) -> None:
"""Test retrieving analytics."""
responses.get(
f"{HOMEASSISTANT_ANALYTICS_URL}/data.json",
status=200,
body=load_fixture("data.json"),
)
assert await homeassistant_analytics_client.get_analytics() == snapshot
tests/test_python_homeassistant_analytics.py:105:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
python_homeassistant_analytics/python_homeassistant_analytics.py:87: in
get_analytics
response = await self._request("analytics.home-assistant.io", "data.json")
python_homeassistant_analytics/python_homeassistant_analytics.py:59: in _request
response = await self.session.get(
/usr/lib/python3.12/unittest/mock.py:2293: in _execute_mock_call
result = await effect(*args, **kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <aioresponses.core.aioresponses object at 0x7f9bc95cd6a0>
orig_self = <aiohttp.client.ClientSession object at 0x7f9bc944fa10>
method = 'GET', url = URL('https://analytics.home-assistant.io/data.json')
args = ()
kwargs = {'allow_redirects': True, 'headers': {'Accept': 'application/json,
text/plain, */*', 'User-Agent': 'PythonHomeassistantAnalytics/0.5.0'}}
url_origin = URL('https://analytics.home-assistant.io/data.json')
url_str = 'https://analytics.home-assistant.io/data.json'
key = ('GET', URL('https://analytics.home-assistant.io/data.json'))
request_call = RequestCall(args=(), kwargs={'headers': {'User-Agent':
'PythonHomeassistantAnalytics/0.5.0', 'Accept': 'application/json, text/plain,
*/*'}, 'allow_redirects': True})
response = None
async def _request_mock(self, orig_self: ClientSession,
method: str, url: 'Union[URL, str]',
*args: Tuple,
**kwargs: Any) -> 'ClientResponse':
"""Return mocked response object or raise connection error."""
if orig_self.closed:
raise RuntimeError('Session is closed')
url_origin = url
url = normalize_url(merge_params(url, kwargs.get('params')))
url_str = str(url)
for prefix in self._passthrough:
if url_str.startswith(prefix):
return (await self.patcher.temp_original(
orig_self, method, url_origin, *args, **kwargs
))
key = (method, url)
self.requests.setdefault(key, [])
request_call = self._build_request_call(method, *args, **kwargs)
self.requests[key].append(request_call)
response = await self.match(method, url, **kwargs)
if response is None:
raise ClientConnectionError(
'Connection refused: {} {}'.format(method, url)
)
E aiohttp.client_exceptions.ClientConnectionError: Connection
refused: GET https://analytics.home-assistant.io/data.json
/usr/lib/python3/dist-packages/aioresponses/core.py:515: ClientConnectionError
__________________________________ test_etags __________________________________
responses = <aioresponses.core.aioresponses object at 0x7f9bc944e000>
homeassistant_analytics_client =
HomeassistantAnalyticsClient(session=<aiohttp.client.ClientSession object at
0x7f9bc951cda0>, request_timeout=10, api_host='analytics.home-assistant.io',
_close_session=False, _etags={})
async def test_etags(
responses: aioresponses,
homeassistant_analytics_client: HomeassistantAnalyticsClient,
) -> None:
"""Test retrieving current analytics."""
responses.get(
f"{HOMEASSISTANT_ANALYTICS_URL}/current_data.json",
status=200,
body=load_fixture("current_data.json"),
headers={"etag": "123"},
)
responses.get(
f"{HOMEASSISTANT_ANALYTICS_URL}/current_data.json",
status=304,
)
assert await homeassistant_analytics_client.get_current_analytics()
tests/test_python_homeassistant_analytics.py:124:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
python_homeassistant_analytics/python_homeassistant_analytics.py:92: in
get_current_analytics
response = await self._request(
python_homeassistant_analytics/python_homeassistant_analytics.py:59: in _request
response = await self.session.get(
/usr/lib/python3.12/unittest/mock.py:2293: in _execute_mock_call
result = await effect(*args, **kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <aioresponses.core.aioresponses object at 0x7f9bc944e000>
orig_self = <aiohttp.client.ClientSession object at 0x7f9bc951cda0>
method = 'GET'
url = URL('https://analytics.home-assistant.io/current_data.json'), args = ()
kwargs = {'allow_redirects': True, 'headers': {'Accept': 'application/json,
text/plain, */*', 'User-Agent': 'PythonHomeassistantAnalytics/0.5.0'}}
url_origin = URL('https://analytics.home-assistant.io/current_data.json')
url_str = 'https://analytics.home-assistant.io/current_data.json'
key = ('GET', URL('https://analytics.home-assistant.io/current_data.json'))
request_call = RequestCall(args=(), kwargs={'headers': {'User-Agent':
'PythonHomeassistantAnalytics/0.5.0', 'Accept': 'application/json, text/plain,
*/*'}, 'allow_redirects': True})
response = None
async def _request_mock(self, orig_self: ClientSession,
method: str, url: 'Union[URL, str]',
*args: Tuple,
**kwargs: Any) -> 'ClientResponse':
"""Return mocked response object or raise connection error."""
if orig_self.closed:
raise RuntimeError('Session is closed')
url_origin = url
url = normalize_url(merge_params(url, kwargs.get('params')))
url_str = str(url)
for prefix in self._passthrough:
if url_str.startswith(prefix):
return (await self.patcher.temp_original(
orig_self, method, url_origin, *args, **kwargs
))
key = (method, url)
self.requests.setdefault(key, [])
request_call = self._build_request_call(method, *args, **kwargs)
self.requests[key].append(request_call)
response = await self.match(method, url, **kwargs)
if response is None:
raise ClientConnectionError(
'Connection refused: {} {}'.format(method, url)
)
E aiohttp.client_exceptions.ClientConnectionError: Connection
refused: GET https://analytics.home-assistant.io/current_data.json
/usr/lib/python3/dist-packages/aioresponses/core.py:515: ClientConnectionError
____________________________ test_current_analytics ____________________________
responses = <aioresponses.core.aioresponses object at 0x7f9bc944c2c0>
homeassistant_analytics_client =
HomeassistantAnalyticsClient(session=<aiohttp.client.ClientSession object at
0x7f9bc95cd700>, request_timeout=10, api_host='analytics.home-assistant.io',
_close_session=False, _etags={})
snapshot = SnapshotAssertion(name='snapshot', num_executions=0)
async def test_current_analytics(
responses: aioresponses,
homeassistant_analytics_client: HomeassistantAnalyticsClient,
snapshot: SnapshotAssertion,
) -> None:
"""Test retrieving current analytics."""
responses.get(
f"{HOMEASSISTANT_ANALYTICS_URL}/current_data.json",
status=200,
body=load_fixture("current_data.json"),
)
assert await homeassistant_analytics_client.get_current_analytics() ==
snapshot
tests/test_python_homeassistant_analytics.py:152:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
python_homeassistant_analytics/python_homeassistant_analytics.py:92: in
get_current_analytics
response = await self._request(
python_homeassistant_analytics/python_homeassistant_analytics.py:59: in _request
response = await self.session.get(
/usr/lib/python3.12/unittest/mock.py:2293: in _execute_mock_call
result = await effect(*args, **kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <aioresponses.core.aioresponses object at 0x7f9bc944c2c0>
orig_self = <aiohttp.client.ClientSession object at 0x7f9bc95cd700>
method = 'GET'
url = URL('https://analytics.home-assistant.io/current_data.json'), args = ()
kwargs = {'allow_redirects': True, 'headers': {'Accept': 'application/json,
text/plain, */*', 'User-Agent': 'PythonHomeassistantAnalytics/0.5.0'}}
url_origin = URL('https://analytics.home-assistant.io/current_data.json')
url_str = 'https://analytics.home-assistant.io/current_data.json'
key = ('GET', URL('https://analytics.home-assistant.io/current_data.json'))
request_call = RequestCall(args=(), kwargs={'headers': {'User-Agent':
'PythonHomeassistantAnalytics/0.5.0', 'Accept': 'application/json, text/plain,
*/*'}, 'allow_redirects': True})
response = None
async def _request_mock(self, orig_self: ClientSession,
method: str, url: 'Union[URL, str]',
*args: Tuple,
**kwargs: Any) -> 'ClientResponse':
"""Return mocked response object or raise connection error."""
if orig_self.closed:
raise RuntimeError('Session is closed')
url_origin = url
url = normalize_url(merge_params(url, kwargs.get('params')))
url_str = str(url)
for prefix in self._passthrough:
if url_str.startswith(prefix):
return (await self.patcher.temp_original(
orig_self, method, url_origin, *args, **kwargs
))
key = (method, url)
self.requests.setdefault(key, [])
request_call = self._build_request_call(method, *args, **kwargs)
self.requests[key].append(request_call)
response = await self.match(method, url, **kwargs)
if response is None:
raise ClientConnectionError(
'Connection refused: {} {}'.format(method, url)
)
E aiohttp.client_exceptions.ClientConnectionError: Connection
refused: GET https://analytics.home-assistant.io/current_data.json
/usr/lib/python3/dist-packages/aioresponses/core.py:515: ClientConnectionError
______________________________ test_integrations _______________________________
responses = <aioresponses.core.aioresponses object at 0x7f9bc95cd8b0>
homeassistant_analytics_client =
HomeassistantAnalyticsClient(session=<aiohttp.client.ClientSession object at
0x7f9bc951cb30>, request_timeout=10, api_host='analytics.home-assistant.io',
_close_session=False, _etags={})
snapshot = SnapshotAssertion(name='snapshot', num_executions=0)
async def test_integrations(
responses: aioresponses,
homeassistant_analytics_client: HomeassistantAnalyticsClient,
snapshot: SnapshotAssertion,
) -> None:
"""Test retrieving integrations."""
responses.get(
f"{HOMEASSISTANT_URL}/integrations.json",
status=200,
body=load_fixture("integrations.json"),
)
assert await homeassistant_analytics_client.get_integrations() == snapshot
tests/test_python_homeassistant_analytics.py:166:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
python_homeassistant_analytics/python_homeassistant_analytics.py:100: in
get_integrations
response = await self._request("home-assistant.io", "integrations.json")
python_homeassistant_analytics/python_homeassistant_analytics.py:59: in _request
response = await self.session.get(
/usr/lib/python3.12/unittest/mock.py:2293: in _execute_mock_call
result = await effect(*args, **kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <aioresponses.core.aioresponses object at 0x7f9bc95cd8b0>
orig_self = <aiohttp.client.ClientSession object at 0x7f9bc951cb30>
method = 'GET', url = URL('https://home-assistant.io/integrations.json')
args = ()
kwargs = {'allow_redirects': True, 'headers': {'Accept': 'application/json,
text/plain, */*', 'User-Agent': 'PythonHomeassistantAnalytics/0.5.0'}}
url_origin = URL('https://home-assistant.io/integrations.json')
url_str = 'https://home-assistant.io/integrations.json'
key = ('GET', URL('https://home-assistant.io/integrations.json'))
request_call = RequestCall(args=(), kwargs={'headers': {'User-Agent':
'PythonHomeassistantAnalytics/0.5.0', 'Accept': 'application/json, text/plain,
*/*'}, 'allow_redirects': True})
response = None
async def _request_mock(self, orig_self: ClientSession,
method: str, url: 'Union[URL, str]',
*args: Tuple,
**kwargs: Any) -> 'ClientResponse':
"""Return mocked response object or raise connection error."""
if orig_self.closed:
raise RuntimeError('Session is closed')
url_origin = url
url = normalize_url(merge_params(url, kwargs.get('params')))
url_str = str(url)
for prefix in self._passthrough:
if url_str.startswith(prefix):
return (await self.patcher.temp_original(
orig_self, method, url_origin, *args, **kwargs
))
key = (method, url)
self.requests.setdefault(key, [])
request_call = self._build_request_call(method, *args, **kwargs)
self.requests[key].append(request_call)
response = await self.match(method, url, **kwargs)
if response is None:
raise ClientConnectionError(
'Connection refused: {} {}'.format(method, url)
)
E aiohttp.client_exceptions.ClientConnectionError: Connection
refused: GET https://home-assistant.io/integrations.json
/usr/lib/python3/dist-packages/aioresponses/core.py:515: ClientConnectionError
___________________________ test_custom_integrations ___________________________
responses = <aioresponses.core.aioresponses object at 0x7f9bc951f2f0>
homeassistant_analytics_client =
HomeassistantAnalyticsClient(session=<aiohttp.client.ClientSession object at
0x7f9bc94fc2c0>, request_timeout=10, api_host='analytics.home-assistant.io',
_close_session=False, _etags={})
snapshot = SnapshotAssertion(name='snapshot', num_executions=0)
async def test_custom_integrations(
responses: aioresponses,
homeassistant_analytics_client: HomeassistantAnalyticsClient,
snapshot: SnapshotAssertion,
) -> None:
"""Test retrieving custom integrations."""
responses.get(
f"{HOMEASSISTANT_ANALYTICS_URL}/custom_integrations.json",
status=200,
body=load_fixture("custom_integrations.json"),
)
assert await homeassistant_analytics_client.get_custom_integrations() ==
snapshot
tests/test_python_homeassistant_analytics.py:180:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
python_homeassistant_analytics/python_homeassistant_analytics.py:106: in
get_custom_integrations
response = await self._request(
python_homeassistant_analytics/python_homeassistant_analytics.py:59: in _request
response = await self.session.get(
/usr/lib/python3.12/unittest/mock.py:2293: in _execute_mock_call
result = await effect(*args, **kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <aioresponses.core.aioresponses object at 0x7f9bc951f2f0>
orig_self = <aiohttp.client.ClientSession object at 0x7f9bc94fc2c0>
method = 'GET'
url = URL('https://analytics.home-assistant.io/custom_integrations.json')
args = ()
kwargs = {'allow_redirects': True, 'headers': {'Accept': 'application/json,
text/plain, */*', 'User-Agent': 'PythonHomeassistantAnalytics/0.5.0'}}
url_origin = URL('https://analytics.home-assistant.io/custom_integrations.json')
url_str = 'https://analytics.home-assistant.io/custom_integrations.json'
key = ('GET',
URL('https://analytics.home-assistant.io/custom_integrations.json'))
request_call = RequestCall(args=(), kwargs={'headers': {'User-Agent':
'PythonHomeassistantAnalytics/0.5.0', 'Accept': 'application/json, text/plain,
*/*'}, 'allow_redirects': True})
response = None
async def _request_mock(self, orig_self: ClientSession,
method: str, url: 'Union[URL, str]',
*args: Tuple,
**kwargs: Any) -> 'ClientResponse':
"""Return mocked response object or raise connection error."""
if orig_self.closed:
raise RuntimeError('Session is closed')
url_origin = url
url = normalize_url(merge_params(url, kwargs.get('params')))
url_str = str(url)
for prefix in self._passthrough:
if url_str.startswith(prefix):
return (await self.patcher.temp_original(
orig_self, method, url_origin, *args, **kwargs
))
key = (method, url)
self.requests.setdefault(key, [])
request_call = self._build_request_call(method, *args, **kwargs)
self.requests[key].append(request_call)
response = await self.match(method, url, **kwargs)
if response is None:
raise ClientConnectionError(
'Connection refused: {} {}'.format(method, url)
)
E aiohttp.client_exceptions.ClientConnectionError: Connection
refused: GET https://analytics.home-assistant.io/custom_integrations.json
/usr/lib/python3/dist-packages/aioresponses/core.py:515: ClientConnectionError
--------------------------- snapshot report summary ----------------------------
4 snapshots unused.
Re-run pytest with --snapshot-update to delete unused snapshots.
=========================== short test summary info ============================
FAILED tests/test_python_homeassistant_analytics.py::test_putting_in_own_session
FAILED tests/test_python_homeassistant_analytics.py::test_creating_own_session
FAILED
tests/test_python_homeassistant_analytics.py::test_unexpected_server_response
FAILED tests/test_python_homeassistant_analytics.py::test_timeout - aiohttp.c...
FAILED tests/test_python_homeassistant_analytics.py::test_analytics - aiohttp...
FAILED tests/test_python_homeassistant_analytics.py::test_etags - aiohttp.cli...
FAILED tests/test_python_homeassistant_analytics.py::test_current_analytics
FAILED tests/test_python_homeassistant_analytics.py::test_integrations - aioh...
FAILED tests/test_python_homeassistant_analytics.py::test_custom_integrations
============================== 9 failed in 0.36s ===============================
E: pybuild pybuild:389: test: plugin pyproject failed with: exit code=1: cd
/<<PKGBUILDDIR>>/.pybuild/cpython3_3.12_python-homeassistant-analytics/build;
python3.12 -m pytest --no-cov
dh_auto_test: error: pybuild --test -i python{version} -p 3.12 returned exit
code 13
make: *** [debian/rules:8: binary] Error 25
dpkg-buildpackage: error: debian/rules binary subprocess returned exit status 2
--------------------------------------------------------------------------------
The above is just how the build ends and not necessarily the most relevant part.
If required, the full build log is available here:
https://people.debian.org/~sanvila/build-logs/202410/
About the archive rebuild: The build was made on virtual machines from AWS,
using sbuild and a reduced chroot with only build-essential packages.
If you could not reproduce the bug please contact me privately, as I
am willing to provide ssh access to a virtual machine where the bug is
fully reproducible.
If this is really a bug in one of the build-depends, please use
reassign and affects, so that this is still visible in the BTS web
page for this package.
Thanks.
--- End Message ---