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

Unified Diff: tools/telemetry/third_party/gsutilz/third_party/apitools/apitools/base/py/http_wrapper_test.py

Issue 1264873003: Add gsutil/third_party to telemetry/third_party/gsutilz/third_party. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove httplib2 Created 5 years, 5 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: tools/telemetry/third_party/gsutilz/third_party/apitools/apitools/base/py/http_wrapper_test.py
diff --git a/tools/telemetry/third_party/gsutilz/third_party/apitools/apitools/base/py/http_wrapper_test.py b/tools/telemetry/third_party/gsutilz/third_party/apitools/apitools/base/py/http_wrapper_test.py
new file mode 100644
index 0000000000000000000000000000000000000000..ddb927a4c511f6c615ff186807402b101bc1d135
--- /dev/null
+++ b/tools/telemetry/third_party/gsutilz/third_party/apitools/apitools/base/py/http_wrapper_test.py
@@ -0,0 +1,24 @@
+"""Tests for http_wrapper."""
+import unittest2
+
+from apitools.base.py import http_wrapper
+
+
+class RaisesExceptionOnLen(object):
+
+ """Supports length property but raises if __len__ is used."""
+
+ def __len__(self):
+ raise Exception('len() called unnecessarily')
+
+ def length(self):
+ return 1
+
+
+class HttpWrapperTest(unittest2.TestCase):
+
+ def testRequestBodyUsesLengthProperty(self):
+ http_wrapper.Request(body=RaisesExceptionOnLen())
+
+ def testRequestBodyWithLen(self):
+ http_wrapper.Request(body='burrito')

Powered by Google App Engine
This is Rietveld 408576698