Index: client/libs/logdog/tests/stream_test.py |
diff --git a/client/libs/logdog/tests/stream_test.py b/client/libs/logdog/tests/stream_test.py |
index c05d05f08f8804b751e32c6f13d73a18cdfd7bca..98cbbdacb971f7362546eb45df12b4afdefe2f44 100755 |
--- a/client/libs/logdog/tests/stream_test.py |
+++ b/client/libs/logdog/tests/stream_test.py |
@@ -84,6 +84,10 @@ class StreamClientTestCase(unittest.TestCase): |
def interpret(self): |
data = StringIO.StringIO(self.buffer.getvalue()) |
+ magic = data.read(len(stream.BUTLER_MAGIC)) |
+ if magic != stream.BUTLER_MAGIC: |
+ raise ValueError('Invalid magic value ([%s] != [%s])' % ( |
+ magic, stream.BUTLER_MAGIC)) |
length, _ = varint.read_uvarint(data) |
header = data.read(length) |
return json.loads(header), data.read() |