Skip to content

Commit

Permalink
✅ fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
j1g5awi committed Nov 16, 2023
1 parent 192e81f commit 3eefca4
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 17 deletions.
2 changes: 1 addition & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

def pytest_configure(config: pytest.Config) -> None:
config.stash[NONEBOT_INIT_KWARGS] = {
"driver": "~fastapi+~websockets",
"driver": "~fastapi+~httpx+~websockets",
"datastore_database_url": "sqlite+aiosqlite:///:memory:",
}

Expand Down
5 changes: 2 additions & 3 deletions tests/middlewares/villa/test_villa.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
bot_info = BotInfo(
bot_id="test",
bot_secret="123",
pub_key="""-----BEGIN PUBLIC KEY----- MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCuPr64CTkonwYjeLsAuKZ7HmSS 0gvB3p2kP82BFsEwYiDmlNuzV2aCu/CvfqA9jwGt+lBDzpkb4PyK8tdDNo8RXtUf GJhmY6Qq/Hxn1Zd2AAXeQE6bqyHE0JuM/9APmzfNzVw/UhrNamxXuEM8Xx12NEe8 UpxBHmCQ4dpBlTnVyQIDAQAB -----END PUBLIC KEY-----""",
pub_key="-----BEGIN PUBLIC KEY-----\nMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCxMjm1BVqkCvCjcc8sqS+gxD7x\nx+p6E0sixGuJZgsF0afWkB3DVJiz20QYbtbBjVB+vs+OMFWtezioTqpVPB3XKaa/\nJbWb+Aa+/0ctXoXUWPmfWqY8VGTL87rhH9NMpMHWJn3O2k4GicexwfSV0/02zFh8\n+EwC5xoaVP1iBh4oyQIDAQAB\n-----END PUBLIC KEY-----\n",
)


Expand All @@ -32,6 +32,5 @@ async def test_to_onebot_event(app: App):
assert channel_create.message_id == "C9G5-O2GK-FJB9-EVB0"
assert channel_create.channel_id == "39761"
assert (
channel_create.alt_message
== "MentionedRobot(bot_id='bot_nUcp9kz0I2AhxZGVQDUQ', bot_name='琪露诺')/帮助"
channel_create.alt_message == "<mention_robot:bot_nUcp9kz0I2AhxZGVQDUQ>/帮助"
)
2 changes: 1 addition & 1 deletion tests/onebotimpl/test_bot_connect.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ async def test_bot_connect(app: App, FakeMiddleware):

async with app.test_api() as ctx:
bot = ctx.create_bot()
obimpl.bot_connect(bot)
await obimpl.bot_connect(bot)
assert obimpl.middlewares[bot.self_id].bot == bot
12 changes: 0 additions & 12 deletions tests/onebotimpl/test_call_api.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,6 @@
from nonebug import App


async def test_get_latest_event(app: App, FakeMiddleware):
from nonebot_plugin_all4one import obimpl

async with app.test_api() as ctx:
bot = ctx.create_bot()
middleware = FakeMiddleware(bot)
queue = middleware.new_queue()
events = await obimpl.get_latest_events(queue)
assert events[0].type == "meta"
assert events[0].detail_type == "status_update"


async def test_get_supported_action(app: App, FakeMiddleware):
from nonebot_plugin_all4one import obimpl

Expand Down

0 comments on commit 3eefca4

Please sign in to comment.