mirror of
https://github.com/arcan1s/ahriman.git
synced 2026-04-07 19:03:38 +00:00
This was initally generated by ai, but later has been heavily edited. The reason why it has been implemented is that there are plans to implement more features to ui, but it becomes hard to add new features to plain js, so I decided to rewrite it in typescript. Yet because it is still ai slop, it is still possible to enable old interface via configuration, even though new interface is turned on by default to get feedback
27 lines
878 B
Python
27 lines
878 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 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
|