diff --git a/.gitignore b/.gitignore index 0f459a9..a22f106 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ .cache .coverage +.pytest_cache/ __pycache__ *.pyc node_modules diff --git a/examples/test_client.py b/examples/test_client.py index 58cbcd2..308f0ad 100644 --- a/examples/test_client.py +++ b/examples/test_client.py @@ -47,10 +47,13 @@ async def test_client(): handler.send(True, end=True) break + """ + # TODO: save this blob, first. async for data in api.call('blobs.get', ['&/6q7JOKythgnnzoBI5xxvotCr5HeFkAIZSAuqHiZfLw=.sha256'], 'source'): if data.type.name == 'BUFFER': with open('./funny_img.png', 'wb') as f: f.write(data.data) + """ async def main(): diff --git a/examples/test_server.py b/examples/test_server.py index a4aac05..fe89c75 100644 --- a/examples/test_server.py +++ b/examples/test_server.py @@ -5,13 +5,15 @@ from colorlog import ColoredFormatter from secret_handshake import SHSServer from ssb.packet_stream import PacketStream -from ssb.protocol.streams import stream_api +from ssb.muxrpc import MuxRPCAPI from ssb.util import load_ssb_secret +api = MuxRPCAPI() + async def on_connect(conn): packet_stream = PacketStream(conn) - stream_api.add_connection(packet_stream) + api.add_connection(packet_stream) print('connect', conn) async for msg in packet_stream: diff --git a/requirements.txt b/requirements.txt index e9e1402..ea77c2d 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1 @@ -pynacl -simplejson -pytest -secret-handshake +-r requirements/production.txt diff --git a/requirements/dev.txt b/requirements/dev.txt new file mode 100644 index 0000000..78ef444 --- /dev/null +++ b/requirements/dev.txt @@ -0,0 +1,2 @@ +-r tests.txt +flake8 diff --git a/requirements/production.txt b/requirements/production.txt new file mode 100644 index 0000000..8706457 --- /dev/null +++ b/requirements/production.txt @@ -0,0 +1,5 @@ +colorlog +pynacl +pyyaml +secret-handshake +simplejson diff --git a/requirements/tests.txt b/requirements/tests.txt new file mode 100644 index 0000000..cf7eb53 --- /dev/null +++ b/requirements/tests.txt @@ -0,0 +1,7 @@ +-r production.txt +asynctest +coverage +pytest +pytest-asyncio +pytest-cov +pytest-mock