From 139d90743ca4e40a46be86adb035b4e79a52c10f Mon Sep 17 00:00:00 2001 From: David Poncelow Date: Thu, 3 Dec 2020 15:49:20 -0800 Subject: [PATCH] fix tests broken by taking lint advice --- tests/searchcommands/chunked_data_stream.py | 6 +++--- tests/searchcommands/test_generator_command.py | 3 +++ 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/tests/searchcommands/chunked_data_stream.py b/tests/searchcommands/chunked_data_stream.py index 2e2726fb..ae5363ef 100644 --- a/tests/searchcommands/chunked_data_stream.py +++ b/tests/searchcommands/chunked_data_stream.py @@ -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)) diff --git a/tests/searchcommands/test_generator_command.py b/tests/searchcommands/test_generator_command.py index 7e675a70..4af61a5d 100644 --- a/tests/searchcommands/test_generator_command.py +++ b/tests/searchcommands/test_generator_command.py @@ -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