mirror of
https://github.com/arcan1s/ahriman.git
synced 2025-07-30 06:09:56 +00:00
Compare commits
2 Commits
feature/br
...
c8f25f8769
Author | SHA1 | Date | |
---|---|---|---|
c8f25f8769 | |||
8fcc216cc3 |
4
.github/workflows/docker.yml
vendored
4
.github/workflows/docker.yml
vendored
@ -8,10 +8,6 @@ on:
|
|||||||
- '*'
|
- '*'
|
||||||
- '!*rc*'
|
- '!*rc*'
|
||||||
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
packages: write
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
docker-image:
|
docker-image:
|
||||||
|
|
||||||
|
3
.github/workflows/regress.yml
vendored
3
.github/workflows/regress.yml
vendored
@ -2,9 +2,6 @@ name: Regress
|
|||||||
|
|
||||||
on: workflow_dispatch
|
on: workflow_dispatch
|
||||||
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
run-regress-tests:
|
run-regress-tests:
|
||||||
|
|
||||||
|
3
.github/workflows/release.yml
vendored
3
.github/workflows/release.yml
vendored
@ -5,9 +5,6 @@ on:
|
|||||||
tags:
|
tags:
|
||||||
- '*'
|
- '*'
|
||||||
|
|
||||||
permissions:
|
|
||||||
contents: write
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
make-release:
|
make-release:
|
||||||
|
|
||||||
|
3
.github/workflows/setup.yml
vendored
3
.github/workflows/setup.yml
vendored
@ -8,9 +8,6 @@ on:
|
|||||||
branches:
|
branches:
|
||||||
- master
|
- master
|
||||||
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
run-setup-minimal:
|
run-setup-minimal:
|
||||||
|
|
||||||
|
3
.github/workflows/tests.yml
vendored
3
.github/workflows/tests.yml
vendored
@ -10,9 +10,6 @@ on:
|
|||||||
schedule:
|
schedule:
|
||||||
- cron: 1 0 * * *
|
- cron: 1 0 * * *
|
||||||
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
run-tests:
|
run-tests:
|
||||||
|
|
||||||
|
@ -91,13 +91,7 @@ autoclass_content = "both"
|
|||||||
|
|
||||||
autodoc_member_order = "groupwise"
|
autodoc_member_order = "groupwise"
|
||||||
|
|
||||||
autodoc_mock_imports = [
|
autodoc_mock_imports = ["cryptography", "pyalpm"]
|
||||||
"aioauth_client",
|
|
||||||
"aiohttp_security",
|
|
||||||
"aiohttp_session",
|
|
||||||
"cryptography",
|
|
||||||
"pyalpm",
|
|
||||||
]
|
|
||||||
|
|
||||||
autodoc_default_options = {
|
autodoc_default_options = {
|
||||||
"no-undoc-members": True,
|
"no-undoc-members": True,
|
||||||
|
@ -23,7 +23,7 @@ import sys
|
|||||||
|
|
||||||
from collections.abc import Generator, Mapping, MutableMapping
|
from collections.abc import Generator, Mapping, MutableMapping
|
||||||
from string import Template
|
from string import Template
|
||||||
from typing import Any, ClassVar
|
from typing import ClassVar
|
||||||
|
|
||||||
from ahriman.core.configuration.shell_template import ShellTemplate
|
from ahriman.core.configuration.shell_template import ShellTemplate
|
||||||
|
|
||||||
@ -85,7 +85,7 @@ class ShellInterpolator(configparser.Interpolation):
|
|||||||
"prefix": sys.prefix,
|
"prefix": sys.prefix,
|
||||||
}
|
}
|
||||||
|
|
||||||
def before_get(self, parser: MutableMapping[str, Mapping[str, str]], section: Any, option: Any, value: str,
|
def before_get(self, parser: MutableMapping[str, Mapping[str, str]], section: str, option: str, value: str,
|
||||||
defaults: Mapping[str, str]) -> str:
|
defaults: Mapping[str, str]) -> str:
|
||||||
"""
|
"""
|
||||||
interpolate option value
|
interpolate option value
|
||||||
@ -100,8 +100,8 @@ class ShellInterpolator(configparser.Interpolation):
|
|||||||
|
|
||||||
Args:
|
Args:
|
||||||
parser(MutableMapping[str, Mapping[str, str]]): option parser
|
parser(MutableMapping[str, Mapping[str, str]]): option parser
|
||||||
section(Any): section name
|
section(str): section name
|
||||||
option(Any): option name
|
option(str): option name
|
||||||
value(str): source (not-converted) value
|
value(str): source (not-converted) value
|
||||||
defaults(Mapping[str, str]): default values
|
defaults(Mapping[str, str]): default values
|
||||||
|
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
import pytest
|
import pytest
|
||||||
import pytest_asyncio
|
|
||||||
|
|
||||||
from aiohttp.test_utils import TestClient
|
from aiohttp.test_utils import TestClient
|
||||||
from aiohttp.web import Application, Resource, UrlMappingMatchInfo
|
from aiohttp.web import Application, Resource, UrlMappingMatchInfo
|
||||||
|
from asyncio import BaseEventLoop
|
||||||
from collections.abc import Awaitable, Callable
|
from collections.abc import Awaitable, Callable
|
||||||
from marshmallow import Schema
|
from marshmallow import Schema
|
||||||
from pytest_mock import MockerFixture
|
from pytest_mock import MockerFixture
|
||||||
@ -164,13 +164,15 @@ def application_with_auth(configuration: Configuration, user: User, spawner: Spa
|
|||||||
return application
|
return application
|
||||||
|
|
||||||
|
|
||||||
@pytest_asyncio.fixture
|
@pytest.fixture
|
||||||
async def client(application: Application, aiohttp_client: Any, mocker: MockerFixture) -> TestClient:
|
def client(application: Application, event_loop: BaseEventLoop, aiohttp_client: Any,
|
||||||
|
mocker: MockerFixture) -> TestClient:
|
||||||
"""
|
"""
|
||||||
web client fixture
|
web client fixture
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
application(Application): application fixture
|
application(Application): application fixture
|
||||||
|
event_loop(BaseEventLoop): context event loop
|
||||||
aiohttp_client(Any): aiohttp client fixture
|
aiohttp_client(Any): aiohttp client fixture
|
||||||
mocker(MockerFixture): mocker object
|
mocker(MockerFixture): mocker object
|
||||||
|
|
||||||
@ -178,35 +180,37 @@ async def client(application: Application, aiohttp_client: Any, mocker: MockerFi
|
|||||||
TestClient: web client test instance
|
TestClient: web client test instance
|
||||||
"""
|
"""
|
||||||
mocker.patch("pathlib.Path.iterdir", return_value=[])
|
mocker.patch("pathlib.Path.iterdir", return_value=[])
|
||||||
return await aiohttp_client(application)
|
return event_loop.run_until_complete(aiohttp_client(application))
|
||||||
|
|
||||||
|
|
||||||
@pytest_asyncio.fixture
|
@pytest.fixture
|
||||||
async def client_with_auth(application_with_auth: Application, aiohttp_client: Any,
|
def client_with_auth(application_with_auth: Application, event_loop: BaseEventLoop, aiohttp_client: Any,
|
||||||
|
mocker: MockerFixture) -> TestClient:
|
||||||
|
"""
|
||||||
|
web client fixture with full authorization functions
|
||||||
|
|
||||||
|
Args:
|
||||||
|
application_with_auth(Application): application fixture
|
||||||
|
event_loop(BaseEventLoop): context event loop
|
||||||
|
aiohttp_client(Any): aiohttp client fixture
|
||||||
|
mocker(MockerFixture): mocker object
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
TestClient: web client test instance
|
||||||
|
"""
|
||||||
|
mocker.patch("pathlib.Path.iterdir", return_value=[])
|
||||||
|
return event_loop.run_until_complete(aiohttp_client(application_with_auth))
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.fixture
|
||||||
|
def client_with_oauth_auth(application_with_auth: Application, event_loop: BaseEventLoop, aiohttp_client: Any,
|
||||||
mocker: MockerFixture) -> TestClient:
|
mocker: MockerFixture) -> TestClient:
|
||||||
"""
|
"""
|
||||||
web client fixture with full authorization functions
|
web client fixture with full authorization functions
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
application_with_auth(Application): application fixture
|
application_with_auth(Application): application fixture
|
||||||
aiohttp_client(Any): aiohttp client fixture
|
event_loop(BaseEventLoop): context event loop
|
||||||
mocker(MockerFixture): mocker object
|
|
||||||
|
|
||||||
Returns:
|
|
||||||
TestClient: web client test instance
|
|
||||||
"""
|
|
||||||
mocker.patch("pathlib.Path.iterdir", return_value=[])
|
|
||||||
return await aiohttp_client(application_with_auth)
|
|
||||||
|
|
||||||
|
|
||||||
@pytest_asyncio.fixture
|
|
||||||
async def client_with_oauth_auth(application_with_auth: Application, aiohttp_client: Any,
|
|
||||||
mocker: MockerFixture) -> TestClient:
|
|
||||||
"""
|
|
||||||
web client fixture with full authorization functions
|
|
||||||
|
|
||||||
Args:
|
|
||||||
application_with_auth(Application): application fixture
|
|
||||||
aiohttp_client(Any): aiohttp client fixture
|
aiohttp_client(Any): aiohttp client fixture
|
||||||
mocker(MockerFixture): mocker object
|
mocker(MockerFixture): mocker object
|
||||||
|
|
||||||
@ -215,4 +219,4 @@ async def client_with_oauth_auth(application_with_auth: Application, aiohttp_cli
|
|||||||
"""
|
"""
|
||||||
mocker.patch("pathlib.Path.iterdir", return_value=[])
|
mocker.patch("pathlib.Path.iterdir", return_value=[])
|
||||||
application_with_auth[AuthKey] = MagicMock(spec=OAuth)
|
application_with_auth[AuthKey] = MagicMock(spec=OAuth)
|
||||||
return await aiohttp_client(application_with_auth)
|
return event_loop.run_until_complete(aiohttp_client(application_with_auth))
|
||||||
|
Reference in New Issue
Block a user