Skip to content

Commit

Permalink
fix tests broken by taking lint advice
Browse files Browse the repository at this point in the history
  • Loading branch information
zenmoto committed Dec 3, 2020
1 parent efaa7e1 commit 139d907
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/searchcommands/chunked_data_stream.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,11 @@ def __init__(self, stream):
def read_chunk(self):
header = self.stream.readline()

while header > 0 and header.strip() == b'':
while len(header) > 0 and header.strip() == b'':
header = self.stream.readline() # Skip empty lines

if not header == 0:
if len(header) == 0:
raise EOFError

version, meta, data = header.rstrip().split(b',')
metabytes = self.stream.read(int(meta))
databytes = self.stream.read(int(data))
Expand Down
3 changes: 3 additions & 0 deletions tests/searchcommands/test_generator_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ def generate(self):
finished_seen = chunk.meta.get("finished", False)
for row in chunk.data:
seen.add(row["event_index"])
print(out_stream.getvalue())
print(expected)
print(seen)
assert expected.issubset(seen)
assert finished_seen

Expand Down

0 comments on commit 139d907

Please sign in to comment.