Commit e5c83fa6 authored by xa's avatar xa

cleanup

parent 606faf47
......@@ -23,7 +23,7 @@ var/
*.egg-info/
.installed.cfg
*.egg
.database/
# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
......
import struct
from collections import namedtuple
from .exceptions import MessageError
RawResponse = namedtuple('RawResponse', 'type body')
RawError = namedtuple('RawError', 'type error body')
......
......@@ -12,6 +12,8 @@ from time import sleep
os.environ['PYTHONASYNCIODEBUG'] = '1'
# logging.basicConfig(level=logging.DEBUG)
warnings.simplefilter("always")
warnings.filterwarnings('ignore', '.*sys.meta_path is empty.*')
try:
import coloredlogs
......@@ -25,7 +27,7 @@ else:
here = os.path.dirname(os.path.abspath(__file__))
filepath = lambda *x: os.path.join(here, *x)
database_dir = os.path.join(here, 'database')
database_dir = os.path.join(here, '.database')
data = os.makedirs(database_dir, exist_ok=True)
filelist = [ f for f in os.listdir(database_dir) if f.endswith('.dat') ]
......@@ -60,7 +62,7 @@ class Service:
shell=False)
self.proc = proc
print('Starting %s [%s] %s' % (self.name, proc.pid, ' '.join(self.cmd)))
sleep(.2)
sleep(1)
def stop(self):
if not self.proc:
......
{"topics":[{"channels":[{"name":"chan1","paused":false}],"name":"topic-False-False-True","paused":false},{"channels":[{"name":"chan1","paused":false}],"name":"topic-tls-1","paused":false},{"channels":[],"name":"test","paused":false},{"channels":[{"name":"chan1","paused":false}],"name":"topic1","paused":false},{"channels":[{"name":"chan1","paused":false}],"name":"topic-False-True-False","paused":false},{"channels":[{"name":"chan1","paused":false}],"name":"topic-True-False-True","paused":false},{"channels":[{"name":"chan1","paused":false}],"name":"topic-True-False-False","paused":false},{"channels":[{"name":"chan1","paused":false}],"name":"topic-False-False-False","paused":false},{"channels":[{"name":"chan1","paused":false}],"name":"topic-deflate-1","paused":false},{"channels":[{"name":"chan1","paused":false}],"name":"topic-snappy-1","paused":false},{"channels":[{"name":"chan1","paused":false}],"name":"topic-True-True-False","paused":false}],"version":"0.3.5"}
\ No newline at end of file
......@@ -90,11 +90,11 @@ def test_stats():
@pytest.mark.asyncio
def test_publish():
client = NSQClient('http://127.0.0.1:4151')
data = yield from client.publish('test', 'hello world 1')
data = yield from client.publish('topic1', 'hello world 1')
assert data is True
data = yield from client.multi_publish('test', ['hello world 2',
'hello world 3'])
data = yield from client.multi_publish('topic1', ['hello world 2',
'hello world 3'])
assert data is True
client.close()
yield from client.wait_closed()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment