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

Unified Diff: recipe_engine/third_party/client-py/libs/logdog/tests/stream_test.py

Issue 2265673002: Add LogDog / annotation protobuf support. (Closed) Base URL: https://github.com/luci/recipes-py@step-formal-struct
Patch Set: Updated with comments, added test, proto 3.0.2. Created 4 years, 3 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
Index: recipe_engine/third_party/client-py/libs/logdog/tests/stream_test.py
diff --git a/recipe_engine/third_party/client-py/libs/logdog/tests/stream_test.py b/recipe_engine/third_party/client-py/libs/logdog/tests/stream_test.py
index c05d05f08f8804b751e32c6f13d73a18cdfd7bca..98cbbdacb971f7362546eb45df12b4afdefe2f44 100755
--- a/recipe_engine/third_party/client-py/libs/logdog/tests/stream_test.py
+++ b/recipe_engine/third_party/client-py/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()

Powered by Google App Engine
This is Rietveld 408576698