1
Fork 0
mirror of https://github.com/RYGhub/royalnet.git synced 2024-11-23 19:44:20 +00:00

💥 *things happened here*

This commit is contained in:
Steffo 2021-03-31 23:49:01 +02:00
parent ed9f05ba13
commit f3af9394f5
Signed by: steffo
GPG key ID: 6965406171929D01
2 changed files with 6 additions and 15 deletions

View file

@ -2,13 +2,7 @@
<module type="PYTHON_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/royalnet_console" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/royalnet_console/tests" isTestSource="true" />
<excludeFolder url="file://$MODULE_DIR$/dist" />
<excludeFolder url="file://$MODULE_DIR$/royalnet_console.egg-info" />
<excludeFolder url="file://$MODULE_DIR$/.pytest_cache" />
</content>
<content url="file://$MODULE_DIR$" />
<orderEntry type="jdk" jdkName="Poetry (royalnet-console)" jdkType="Python SDK" />
<orderEntry type="sourceFolder" forTests="false" />
</component>

View file

@ -1,6 +1,6 @@
import pytest
from royalnet_console.pda import ConsolePDA
from royalnet.engineer import PartialCommand, Sentry, Message
import royalnet.engineer as engi
def test_construction():
@ -15,22 +15,19 @@ def pda():
@pytest.fixture
def command():
@PartialCommand.new(syntax="")
async def test(*, _sentry: Sentry, _msg: Message, **__):
"""
Ah, non lo so io!
"""
@engi.PartialCommand.new(syntax="")
async def test(*, _sentry: engi.Sentry, _msg: engi.Message, **__):
await _msg.reply(text=r"test")
return test
def test_registration(pda: ConsolePDA, command: PartialCommand):
def test_registration(pda: ConsolePDA, command: engi.PartialCommand):
pda.register_partial(command, ["test"])
@pytest.fixture
def pda_with_command(pda: ConsolePDA, command: PartialCommand):
def pda_with_command(pda: ConsolePDA, command: engi.PartialCommand):
pda.register_partial(command, ["test"])
return pda