fix test_server and reorganize requirements files
This commit is contained in:
parent
dc1389d634
commit
aab2ac18b3
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,5 +1,6 @@
|
|||||||
.cache
|
.cache
|
||||||
.coverage
|
.coverage
|
||||||
|
.pytest_cache/
|
||||||
__pycache__
|
__pycache__
|
||||||
*.pyc
|
*.pyc
|
||||||
node_modules
|
node_modules
|
||||||
|
@ -47,10 +47,13 @@ async def test_client():
|
|||||||
handler.send(True, end=True)
|
handler.send(True, end=True)
|
||||||
break
|
break
|
||||||
|
|
||||||
|
"""
|
||||||
|
# TODO: save this blob, first.
|
||||||
async for data in api.call('blobs.get', ['&/6q7JOKythgnnzoBI5xxvotCr5HeFkAIZSAuqHiZfLw=.sha256'], 'source'):
|
async for data in api.call('blobs.get', ['&/6q7JOKythgnnzoBI5xxvotCr5HeFkAIZSAuqHiZfLw=.sha256'], 'source'):
|
||||||
if data.type.name == 'BUFFER':
|
if data.type.name == 'BUFFER':
|
||||||
with open('./funny_img.png', 'wb') as f:
|
with open('./funny_img.png', 'wb') as f:
|
||||||
f.write(data.data)
|
f.write(data.data)
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
async def main():
|
async def main():
|
||||||
|
@ -5,13 +5,15 @@ from colorlog import ColoredFormatter
|
|||||||
|
|
||||||
from secret_handshake import SHSServer
|
from secret_handshake import SHSServer
|
||||||
from ssb.packet_stream import PacketStream
|
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
|
from ssb.util import load_ssb_secret
|
||||||
|
|
||||||
|
api = MuxRPCAPI()
|
||||||
|
|
||||||
|
|
||||||
async def on_connect(conn):
|
async def on_connect(conn):
|
||||||
packet_stream = PacketStream(conn)
|
packet_stream = PacketStream(conn)
|
||||||
stream_api.add_connection(packet_stream)
|
api.add_connection(packet_stream)
|
||||||
|
|
||||||
print('connect', conn)
|
print('connect', conn)
|
||||||
async for msg in packet_stream:
|
async for msg in packet_stream:
|
||||||
|
@ -1,4 +1 @@
|
|||||||
pynacl
|
-r requirements/production.txt
|
||||||
simplejson
|
|
||||||
pytest
|
|
||||||
secret-handshake
|
|
||||||
|
2
requirements/dev.txt
Normal file
2
requirements/dev.txt
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
-r tests.txt
|
||||||
|
flake8
|
5
requirements/production.txt
Normal file
5
requirements/production.txt
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
colorlog
|
||||||
|
pynacl
|
||||||
|
pyyaml
|
||||||
|
secret-handshake
|
||||||
|
simplejson
|
7
requirements/tests.txt
Normal file
7
requirements/tests.txt
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
-r production.txt
|
||||||
|
asynctest
|
||||||
|
coverage
|
||||||
|
pytest
|
||||||
|
pytest-asyncio
|
||||||
|
pytest-cov
|
||||||
|
pytest-mock
|
Loading…
Reference in New Issue
Block a user