Spec out first steps, nothing works yet
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
Luke Murphy
2020-06-30 15:09:04 +02:00
parent 18fae5a233
commit 1c67ca74e4
7 changed files with 40 additions and 3 deletions

8
test/conftest.py Normal file
View File

@ -0,0 +1,8 @@
import pytest
@pytest.fixture
def smc():
from simple_message_channels import SimpleMessageChannel
return SimpleMessageChannel()

10
test/test_smc.py Normal file
View File

@ -0,0 +1,10 @@
async def test_send_recv(smc):
channel, type, message = 0, 0, b"abc"
payload = await smc.send(channel, type, message)
assert isinstance(payload, bytes)
async with smc.recv(payload) as response:
assert response.channel == channel
assert response.type == type
assert response.message == message