From cf2033627b63e4a444ee8971fd05f3e88e45fe86 Mon Sep 17 00:00:00 2001 From: Kyomotoi <0w0@imki.moe> Date: Thu, 11 May 2023 14:56:58 +0800 Subject: =?UTF-8?q?=E2=9C=85=20=E6=9B=B4=E6=96=B0=E6=B5=8B=E8=AF=95?= =?UTF-8?q?=E7=94=A8=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/test_plugin_code_runner.py | 75 ----------------------------------------- 1 file changed, 75 deletions(-) delete mode 100644 test/test_plugin_code_runner.py (limited to 'test/test_plugin_code_runner.py') diff --git a/test/test_plugin_code_runner.py b/test/test_plugin_code_runner.py deleted file mode 100644 index ec9eb2d..0000000 --- a/test/test_plugin_code_runner.py +++ /dev/null @@ -1,75 +0,0 @@ -import pytest -from nonebug import App - -from .utils import make_fake_message, make_fake_event - - -@pytest.mark.asyncio -async def test_code_runner(app: App): - from ATRI.plugins.code_runner import code_runner - - Message = make_fake_message() - - async with app.test_matcher(code_runner) as ctx: - bot = ctx.create_bot() - - msg = Message("/code") - event = make_fake_event(_message=msg)() - - ctx.receive_event(bot, event) - ctx.should_call_send(event, "请键入 /code.help 以获取帮助~!", True) - - async with app.test_matcher(code_runner) as ctx: - bot = ctx.create_bot() - - msg = Message("/code.help") - event = make_fake_event(_message=msg)() - - ctx.receive_event(bot, event) - ctx.should_call_send( - event, - """ - /code {语言} - {代码} - For example: - /code python - print('hello world') - """.strip(), - True, - ) - - async with app.test_matcher(code_runner) as ctx: - bot = ctx.create_bot() - - msg = Message("/code.list") - event = make_fake_event(_message=msg)() - - ctx.receive_event(bot, event) - ctx.should_call_send( - event, - """ - 咱现在支持的语言如下: - assembly, bash, c, clojure, - coffeescript, cpp, csharp, - erlang, fsharp, go, groovy, - haskell, java, javascript, - julia, kotlin, lua, perl, - php, python, ruby, rust, - scala, swift, typescript - """.strip(), - True, - ) - - async with app.test_matcher(code_runner) as ctx: - bot = ctx.create_bot() - - msg = Message( - """ - /code python - print("hello world") - """ - ) - event = make_fake_event(_message=msg)() - - ctx.receive_event(bot, event) - ctx.should_call_send(event, "stdout:\nhello world", True) -- cgit v1.2.3