Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
trecouvr committed Sep 20, 2013
1 parent c8f4b37 commit b5bf6c1
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 11 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@ python:
install: "pip install -r python3/requirements.txt --use-mirrors"
# command to run tests
before_script:
- python -c "import zmq; print(zmq.zmq_version()); print(zmq.pyzmq_version());"
- cd python3
script: tests/runall.py
10 changes: 5 additions & 5 deletions python3/tests/test_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,11 @@ def test_launch(self):
class BaseServerAndClientsTestCase(BaseServerTestCase):

def setUp(self):
client1 = self.BasicClient("Client-1", "tcp://*:%s"%self.FRONTEND_PORT,
"tcp://*:%s"%self.EV_PUBLISHER)
client2 = self.BasicClient("Client-2", "tcp://*:%s"%self.BACKEND_PORT,
ev_push_addr="tcp://*:%s"%self.EV_PULLER)
client3 = self.BasicClient("Client-3", "tcp://*:%s"%self.BACKEND_PORT)
client1 = self.BasicClient("Client-1", "tcp://localhost:%s"%self.FRONTEND_PORT,
"tcp://localhost:%s"%self.EV_PUBLISHER)
client2 = self.BasicClient("Client-2", "tcp://localhost:%s"%self.BACKEND_PORT,
ev_push_addr="tcp://localhost:%s"%self.EV_PULLER)
client3 = self.BasicClient("Client-3", "tcp://localhost:%s"%self.BACKEND_PORT)
client1.start(False)
client2.start(False)
client3.start(False)
Expand Down
13 changes: 7 additions & 6 deletions python3/zerobot/ioadapters/arduino.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,10 +216,6 @@ def process_sock_to_io(self, msg):
help_msg = self.help(request)
response = Response(request.uid, help_msg, None)
self.send_multipart([remote_id, response.pack()])
elif request.fct == 'kill':
resp = Response(request.uid, 'goobye', None)
self.send_multipart([remote_id, response.pack()])
quit()
# sinon c'est un appel a une fonction
else:
uid = request.uid
Expand All @@ -238,12 +234,17 @@ def process_sock_to_io(self, msg):
err['error'] = str(ex)
response = Response(request.uid, None, err)
self.send_multipart([remote_id, response.pack()])


def kill(self, request):
resp = Response(request.uid, 'goobye', None)
self.send_multipart([remote_id, response.pack()])
quit()

def help(self, request):
if not request.args:
return '\n'.join(( str(v) for v in self.functions.values()))
else:
return self.functions[request.args[0]].__doc__ + ['kill']
return self.functions[request.args[0]].__doc__

def load_protocol_from_file(self, protocol_file, prefix, prefix_erreur):
"""
Expand Down

0 comments on commit b5bf6c1

Please sign in to comment.