mirror of
https://github.com/arcan1s/ahriman.git
synced 2026-11-22 09:39:30 +00:00
type: add type annotation pylint check
Also run pylint against tests tree
This commit is contained in:
1 parent
71c5d58264
commit
0bd22a049c
39 files changed
+190
-61
No files matched your search
@@ -55,7 +55,7 @@ def test_run(args: argparse.Namespace, configuration: Configuration, repository:
|
||||
join_mock.assert_called_once_with()
|
||||
|
||||
|
||||
def test_extract_arguments(args: argparse.Namespace, configuration: Configuration):
|
||||
def test_extract_arguments(args: argparse.Namespace, configuration: Configuration) -> None:
|
||||
"""
|
||||
must extract correct args
|
||||
"""
|
||||
@@ -87,7 +87,7 @@ def test_extract_arguments(args: argparse.Namespace, configuration: Configuratio
|
||||
assert list(Web.extract_arguments(probe, configuration)) == expected
|
||||
|
||||
|
||||
def test_extract_arguments_full(parser: argparse.ArgumentParser, configuration: Configuration):
|
||||
def test_extract_arguments_full(parser: argparse.ArgumentParser, configuration: Configuration) -> None:
|
||||
"""
|
||||
must extract all available args except for blacklisted
|
||||
"""
|
||||
|
||||
@@ -13,9 +13,9 @@ def test_info() -> None:
|
||||
"""
|
||||
must generate info object for swagger
|
||||
"""
|
||||
info = _info()
|
||||
assert info["title"] == "ahriman"
|
||||
assert info["version"] == __version__
|
||||
text = _info()
|
||||
assert text["title"] == "ahriman"
|
||||
assert text["version"] == __version__
|
||||
|
||||
|
||||
def test_security() -> None:
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import logging
|
||||
import pytest
|
||||
|
||||
from unittest.mock import AsyncMock, MagicMock
|
||||
from typing import Any
|
||||
from unittest.mock import AsyncMock, MagicMock
|
||||
|
||||
from ahriman.web.middlewares.request_id_handler import request_id_handler
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ def test_routes_dynamic_not_found(configuration: Configuration, mocker: MockerFi
|
||||
must disable docs route if no apispec package found
|
||||
"""
|
||||
mocker.patch("ahriman.web.views.api.docs.aiohttp_apispec", None)
|
||||
assert DocsView.routes(configuration) == []
|
||||
assert not DocsView.routes(configuration)
|
||||
|
||||
|
||||
async def test_get(client: TestClient) -> None:
|
||||
|
||||
@@ -106,7 +106,7 @@ def test_routes_dynamic_not_found(configuration: Configuration, mocker: MockerFi
|
||||
must disable openapi route if no apispec package found
|
||||
"""
|
||||
mocker.patch("ahriman.web.views.api.swagger.aiohttp_apispec", None)
|
||||
assert SwaggerView.routes(configuration) == []
|
||||
assert not SwaggerView.routes(configuration)
|
||||
|
||||
|
||||
async def test_get(client: TestClient, mocker: MockerFixture) -> None:
|
||||
|
||||
@@ -16,4 +16,4 @@ def test_routes_empty(configuration: Configuration) -> None:
|
||||
"""
|
||||
StatusViewGuard.ROUTES = ["route1", "route2"]
|
||||
configuration.set_option("web", "service_only", "yes")
|
||||
assert StatusViewGuard.routes(configuration) == []
|
||||
assert not StatusViewGuard.routes(configuration)
|
||||
@@ -17,7 +17,7 @@ def test_routes() -> None:
|
||||
"""
|
||||
must return correct routes
|
||||
"""
|
||||
assert BaseView.ROUTES == []
|
||||
assert not BaseView.ROUTES
|
||||
|
||||
|
||||
def test_configuration(base: BaseView) -> None:
|
||||
|
||||
@@ -42,7 +42,7 @@ def test_routes_dynamic_not_found(configuration: Configuration) -> None:
|
||||
must disable upload route if option is not set
|
||||
"""
|
||||
configuration.set_option("web", "enable_archive_upload", "no")
|
||||
assert UploadView.routes(configuration) == []
|
||||
assert not UploadView.routes(configuration)
|
||||
|
||||
|
||||
async def test_save_file(mocker: MockerFixture) -> None:
|
||||
|
||||
Reference in new issue
Block a user