mirror of
https://github.com/arcan1s/ahriman.git
synced 2026-07-19 00:51:08 +00:00
700893ecac
* 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
28 lines
920 B
Python
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
|