mirror of
https://github.com/arcan1s/ahriman.git
synced 2026-08-24 09:07:27 +00:00
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
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
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
|
||||
Reference in New Issue
Block a user