Files
ahriman/ahriman-web/tests/ahriman/web/test_server_info.py
T
arcanis 700893ecac build: subpackages implementation (#164)
* migrate to hatch

* reorder tests

* generic fixtures

* straight forward conftest

* fix docs generation

* fix tox environments

* reformat tomls

* cleanup pyproject

* some play with renaming

* move root conftest into pytest plugins

* fix setup script

* move fixtures to __init__.py

* remove duplicate fixtures

* disable pylint warning

* simplify configuration fixture

* remove empty conftest

* remove crap from local pyprojects
2026-07-17 14:00:20 +03:00

28 lines
920 B
Python

import pytest
from aiohttp.web import Application
from ahriman import __version__
from ahriman.models.repository_id import RepositoryId
from ahriman.web.server_info import server_info
from ahriman.web.views.index import IndexView
async def test_server_info(application: Application, repository_id: RepositoryId) -> None:
"""
must generate server info
"""
request = pytest.helpers.request(application, "", "GET")
view = IndexView(request)
result = await server_info(view)
assert result["repositories"] == [{"id": repository_id.id, **repository_id.view()}]
assert not result["auth"]["enabled"]
assert not result["auth"]["external"]
assert result["auth"]["username"] is None
assert result["auth"]["control"]
assert result["version"] == __version__
assert result["autorefresh_intervals"] == []
assert result["docs_enabled"]
assert result["index_url"] is None