fix test_server and reorganize requirements files

This commit is contained in:
Cléber Zavadniak 2018-04-19 23:00:22 -03:00 committed by Pedro Ferreira
parent dc1389d634
commit aab2ac18b3
7 changed files with 23 additions and 6 deletions

1
.gitignore vendored
View File

@ -1,5 +1,6 @@
.cache
.coverage
.pytest_cache/
__pycache__
*.pyc
node_modules

View File

@ -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():

View File

@ -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:

View File

@ -1,4 +1 @@
pynacl
simplejson
pytest
secret-handshake
-r requirements/production.txt

2
requirements/dev.txt Normal file
View File

@ -0,0 +1,2 @@
-r tests.txt
flake8

View File

@ -0,0 +1,5 @@
colorlog
pynacl
pyyaml
secret-handshake
simplejson

7
requirements/tests.txt Normal file
View File

@ -0,0 +1,7 @@
-r production.txt
asynctest
coverage
pytest
pytest-asyncio
pytest-cov
pytest-mock