Skip to content

Commit

Permalink
Fix tests after changing ZMQ sockets to DEALER-BROKER
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonathan McCall committed Dec 10, 2018
1 parent 28b0bc9 commit 7a23ac7
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions locust/test/test_runners.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,14 @@ def recv(self):
def send(self, message):
self.outbox.append(message.serialize())

def send_to_client(self, message):
self.outbox.append([message.node_id, message.serialize()])

def recv_from_client(self):
results = self.queue.get()
msg = Message.unserialize(results)
return msg.node_id, msg

return MockedRpcServer


Expand Down Expand Up @@ -218,7 +226,7 @@ class MyTestLocust(Locust):

num_clients = 0
for msg in server.outbox:
num_clients += Message.unserialize(msg).data["num_clients"]
num_clients += Message.unserialize(msg[1]).data["num_clients"]

self.assertEqual(7, num_clients, "Total number of locusts that would have been spawned is not 7")

Expand All @@ -238,7 +246,7 @@ class MyTestLocust(Locust):

num_clients = 0
for msg in server.outbox:
num_clients += Message.unserialize(msg).data["num_clients"]
num_clients += Message.unserialize(msg[1]).data["num_clients"]

self.assertEqual(2, num_clients, "Total number of locusts that would have been spawned is not 2")

Expand Down

0 comments on commit 7a23ac7

Please sign in to comment.