From ef4bb1967081ea9b62a37e9cf9ecc7bf5f4a2d23 Mon Sep 17 00:00:00 2001 From: Ju4tCode <42488585+yanyongyu@users.noreply.github.com> Date: Sun, 6 Aug 2023 04:21:49 +0000 Subject: [PATCH] :bookmark: bump version 2.2.4 --- pyproject.toml | 4 +--- tests/v12/test_v12_connection.py | 8 ++++++++ 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 3eb1a622..f4538402 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "nonebot-adapter-onebot" -version = "2.2.3" +version = "2.2.4" description = "OneBot(CQHTTP) adapter for nonebot2" authors = ["yanyongyu "] license = "MIT" @@ -25,7 +25,6 @@ nonebot2 = "^2.0.0-beta.3" typing-extensions = ">=4.0.0,<5.0.0" [tool.poetry.group.dev.dependencies] -pycln = "^2.1.3" isort = "^5.10.1" black = "^23.1.0" ruff = "^0.0.282" @@ -40,7 +39,6 @@ nonebot2 = { git = "https://github.com/nonebot/nonebot2.git", branch = "master", ] } [tool.pytest.ini_options] -asyncio_mode = "auto" addopts = "--cov nonebot.adapters.onebot --cov-report term-missing" [tool.black] diff --git a/tests/v12/test_v12_connection.py b/tests/v12/test_v12_connection.py index 954cb1e1..786b1005 100644 --- a/tests/v12/test_v12_connection.py +++ b/tests/v12/test_v12_connection.py @@ -84,6 +84,7 @@ async def test_ws(app: App, endpoints: str): assert "2345678" not in adapter.bots +@pytest.mark.asyncio async def test_ws_missing_connect_meta_event(app: App): endpoints = "/onebot/v12/" @@ -104,6 +105,7 @@ async def test_ws_missing_connect_meta_event(app: App): } +@pytest.mark.asyncio async def test_ws_duplicate_bot(app: App): """测试连接两个相同 id 但协议不同的 bot""" from nonebot.adapters.onebot.v11 import Adapter @@ -161,6 +163,7 @@ async def test_ws_duplicate_bot(app: App): adapter.bot_disconnect(nonebot.get_bot("0")) +@pytest.mark.asyncio async def test_http_auth_missing(app: App): endpoints = "/onebot/v12/" @@ -174,6 +177,7 @@ async def test_http_auth_missing(app: App): assert resp.status_code == 403 +@pytest.mark.asyncio async def test_http_auth_header(app: App): from nonebot.adapters.onebot.v12 import Adapter @@ -197,6 +201,7 @@ async def test_http_auth_header(app: App): adapter.bot_disconnect(nonebot.get_bot("0")) +@pytest.mark.asyncio async def test_http_auth_query(app: App): from nonebot.adapters.onebot.v12 import Adapter @@ -219,6 +224,7 @@ async def test_http_auth_query(app: App): adapter.bot_disconnect(nonebot.get_bot("0")) +@pytest.mark.asyncio async def test_ws_auth_missing(app: App): endpoints = "/onebot/v12/" @@ -232,6 +238,7 @@ async def test_ws_auth_missing(app: App): pass +@pytest.mark.asyncio async def test_ws_auth_header(app: App): endpoints = "/onebot/v12/" @@ -255,6 +262,7 @@ async def test_ws_auth_header(app: App): assert "0" not in nonebot.get_bots() +@pytest.mark.asyncio async def test_ws_auth_query(app: App): endpoints = "/onebot/v12/?access_token=test"