Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(22)

Unified Diff: client/libs/logdog/tests/stream_test.py

Issue 2251413004: LogDog: Properly emit Butler stream magic. (Closed) Base URL: https://github.com/luci/luci-py@master
Patch Set: Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « client/libs/logdog/stream.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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()
« no previous file with comments | « client/libs/logdog/stream.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698