Skip to content
This repository has been archived by the owner on Feb 22, 2020. It is now read-only.

Commit

Permalink
fix unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
felix committed Sep 25, 2019
1 parent ab4143d commit 31f53bc
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions tests/test_raw_bytes_send.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,12 @@ def test_send_recv_raw_bytes(self):
for j in range(random.randint(10, 20)):
d = msg.request.index.docs.add()
d.raw_bytes = b'a' * random.randint(100, 1000)
raw_bytes = [d.raw_bytes for d in msg.request.index.docs]
c1.send_message(msg, squeeze_pb=True)
r_msg = c2.recv_message()
for d, r_d in zip(msg.request.index.docs, r_msg.request.index.docs):
self.assertEqual(d.raw_bytes, r_d.raw_bytes)
self.assertEqual(d.raw_bytes, b'')
self.assertEqual(raw_bytes, r_d.raw_bytes)
print('.', end='')
print('checked %d docs' % len(msg.request.index.docs))

Expand Down Expand Up @@ -128,10 +130,12 @@ def test_benchmark3(self):

with ZmqClient(self.c1_args) as c1, ZmqClient(self.c2_args) as c2:
for m in all_msgs:
raw_bytes = [d.raw_bytes for d in m.request.index.docs]
c1.send_message(m, squeeze_pb=True)
r_m = c2.recv_message()
for d, r_d in zip(m.request.index.docs, r_m.request.index.docs):
self.assertEqual(d.raw_bytes, r_d.raw_bytes)
self.assertEqual(d.raw_bytes, b'')
self.assertEqual(raw_bytes, r_d.raw_bytes)

def test_benchmark4(self):
all_msgs = self.build_msgs2()
Expand Down

0 comments on commit 31f53bc

Please sign in to comment.